Copy fields data to a new record

imwalrus38

Registered User.
Local time
Yesterday, 16:59
Joined
May 27, 2005
Messages
31
I have a form in which auditors complete error information for data entry techs. In many instances the next record will be the same auditor and dadat entry tech. I would like to create a button that will make the next record auto fill the data entery tech and auditor name. This will make it faster for the user to enter data.

Any help will be appreciated.

Thanks

John
 
This is usually done by assigning the current value of a control to the control's Default value. The next new record will automatically have this value until the value is manually changed or until the form is closed. I asume that your fields are text, but I'll give you the code for various datatypes, in case you need it later:

Code:
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

For Date fields

Private Sub YourDateControlName_AfterUpdate()
If Not IsNull(Me.YourDateControlName.Value) Then
  YourDateControlName.DefaultValue ="#" &  Me.YourDateControlName & "#"
End If
End Sub
 
Worked like a charm. Thanks alot.
 

Users who are viewing this thread

Back
Top Bottom