View Single Post
  #1  
Old March 18th, 2010, 06:58 PM posted to microsoft.public.access.forms
Iago
external usenet poster
 
Posts: 11
Default Load event question

I found this code along with it's function on this discussion group. It works
great but I want it to populate the text field when the form loads.
How can I get the following code on the Form_Load()?
fOSUserName() is a defined function.

Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo BeforeUpdate_Err

' Set bound controls to system date and time and current user name
Me.DateModified = Now()
Me.ModifiedBy = fOSUserName()

BeforeUpdate_End:
Exit Sub
BeforeUpdate_Err:
MsgBox Err.Description, vbCritical & vbOKOnly, _
"Error Number " & Err.Number & " Occurred"
Resume BeforeUpdate_End
End Sub