Access - Ερωτήσεις / Απαντήσεις Access + VBA... Εδώ δεν υπάρχουν όρια! |
| Εργαλεία Θεμάτων | Τρόποι εμφάνισης |
#1
| |||
| |||
Ενημέρωση πεδίων σε νέα φόρμα, από υπάρχουσα
Hi guys, I would some help with the below. I have a form, in which, the user enters some data and updates a table. This form opens through a button from a previous form where some specific data are retrieved and presented from a different table. What I would like to do, is the empty form to get into some fields data from the previous form, by default, and then the user to fill in the rest by hand. After that, the whole record needs to be stored in a different table. Since the form that needs to update the new table has a "recordset source" linked with the table that finally needs to get updated, I can not bring the data I want from the previous form that has the details that need to be autofilled. So, to make the example realistic, let's say that I have a table with a list of houses and their addresses that is presented in a form. I select one of them, and through a button, a new form opens with the data of a specific house. Then I want a new button inside this last form to open a third form where some data will be auto-filled (let's say the address of the home) and the user will enter some additional info, with data irrelevant to the initial table, where the address is stored. In the end, I want all of the data from the last form to be stored in a new table. Any opinions? Thanks Τελευταία επεξεργασία από το χρήστη Pettor : 12-11-22 στις 17:29. |
#2
| |||
| |||
Hi You need to work with the Current Event and some form variables e.g Κώδικας: Option Compare Database Dim someField as String Dim someOtherField as Integer .................. 'Suppose you want to carry someField from a textbox named baseField Private Sub baseField_AfterUpdate() ' Some Other Code someField = Me.BaseField End Sub Private Sub cboOtherField_AfterUpdate() 'Some Other Code someOtherField =Me.cboOtherField End Sub 'Now on the Current Event Private Sub Form_Current() If me.NewRecord then If Len(SomeField) then Me.BaseField = SomeField If Len(SomeOtherField) then Me.cbOtherField = SomeotherField End if End Sub You start entering data...the very first time you enter the data are stored in the form variables Now on every new record the variables are carrying the values and they fill the controls with the default values...when you change some of the values this are updated on the form's variables and they are carried on the next new Record |
« Προηγούμενο Θέμα
|
Επόμενο Θέμα »
| |
Παρόμοια Θέματα | ||||
Θέμα | Δημιουργός | Forum | Απαντήσεις | Τελευταίο Μήνυμα |
[ Φόρμες ] Ενημερωση πεδιων απο φορμα σε ολα τα πεδία υποφορμας με εντολη vba | artchrist73 | Access - Ερωτήσεις / Απαντήσεις | 3 | 20-06-20 02:06 |
Διαδοχική ενημέρωση πεδίων | gantzinis | Access - Ερωτήσεις / Απαντήσεις | 11 | 19-08-11 19:24 |
Ενημέρωση πεδίων από δευτερεύουσα φόρμα | gmax | Access - Ερωτήσεις / Απαντήσεις | 11 | 08-08-11 12:07 |
Νέος πινακας απο υπάρχουσα φόρμα | Potsikas | Access - Ερωτήσεις / Απαντήσεις | 5 | 04-03-10 16:57 |
Η ώρα είναι 21:27.