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. The syntax varies slightly, depending on the datatype of the data. For your use at this time you'd want to use the Text version, but I'll give you all versions for future reference:
For Text fields
- Private Sub YourTextControlName_AfterUpdate()
-
If Not IsNull(Me.YourTextControlName.Value) Then
-
YourTextControlName.DefaultValue = """" & Me.YourTextControlName.Value & """"
-
End If
-
End Sub
For Date fields
- Private Sub YourDateControlName_AfterUpdate()
-
If Not IsNull(Me.YourDateControlName.Value) Then
-
YourDateControlName.DefaultValue ="#" & Me.YourDateControlName & "#"
-
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
Welcome to Bytes!
Linq ;0)>