How to automatically fill the rest of the fields base on first entry.

hmho

Registered User.
Local time
Today, 10:46
Joined
Apr 7, 2009
Messages
93
If I have form that enter sales data daily and there is one field base on the first entry te rest will be same, forexample when i enter the first field how can I autonaticaly fill the rest of the records based on the first entry. The example below the first field will be the same base on the first entry.

[NumSXT] [ProdName] [ProdPrice]
02xl GBH 10
02xl JLL 25
02xl JKU 36
02xl OPP 25
02xl LIU 25
02xl OLL 26
02xl lPP 25
 
In your form, you can use the AfterUpdate event of the control holding your data to set the DefaultValue for the field. From that time forward, until you either manually change the data or close your form, the data will be entered automatically in each new record.
Code:
Private Sub YourControlName_AfterUpdate()
   Me.YourControlName.DefaultValue = """" & Me.YourControlName.Value & """"
End Sub
 
In your form, you can use the AfterUpdate event of the control holding your data to set the DefaultValue for the field. From that time forward, until you either manually change the data or close your form, the data will be entered automatically in each new record.
Code:
Private Sub YourControlName_AfterUpdate()
   Me.YourControlName.DefaultValue = """" & Me.YourControlName.Value & """"
End Sub
Thanks a lot that workled
 
Will the same code works for date too?
 

Users who are viewing this thread

Back
Top Bottom