Εμφάνιση ενός μόνο μηνύματος
  #2  
Παλιά 15-11-22, 09:36
tsgiannis Ο χρήστης tsgiannis δεν είναι συνδεδεμένος
Όνομα: Γιάννης
Έκδοση λογισμικού Office: Ms-Office 2016
Γλώσσα λογισμικού Office: Αγγλική
 
Εγγραφή: 08-12-2020
Μηνύματα: 153
Προεπιλογή

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
Now the workflow goes like this :
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
Απάντηση με παράθεση