Sure, you just set the DefaultValue for the field in the field's AfterUpdate
event!
After a value is entered, in your date field, for instance, it will
automatically be entered in each new record thereafter until you change it
(in which case the new entry will become the default value) or you close down
the form
The syntax is slightly different, depending on the datatype.
For Date fields
Private Sub YourDateControlName_AfterUpdate()
If Not IsNull(Me.YourDateControlName.Value) Then
YourDateControlName.DefaultValue ="#" & Me.YourDateControlName & "#"
End If
End Sub
For Text fields
Private Sub YourTextControlName_AfterUpdate()
If Not IsNull(Me.YourTextControlName.Value) Then
YourTextControlName.DefaultValue = """" & Me.YourTextControlName.Value &
""""
End If
End Sub
For Numeric fields
Private Sub YourNumericControlName_AfterUpdate()
If Not IsNull(Me.YourNumericControlName.Value) Then
YourNumericControlName.DefaultValue = Me.YourNumericControlName.Value
End If
End Sub
--
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000/2003
Message posted via AccessMonster.com