AfterUpdate problem

sarahb845

Registered User.
Local time
Yesterday, 18:25
Joined
Jun 19, 2002
Messages
43
I have a form that has a couple of required fields (the fields in the table has Required set to "Yes"). They are: Caller Name and CallDtTm.

After the Caller Name is updated, I'd like the CallDtTm set to Now(), only if the CallDtTm is Null or blank. (Basically, I only want the CallDtTm for the record set the first time something is typed into the Caller Name field.)

However, the code below is causing my OnLoad and OnActivate events for the form to fail. (Errors: "Event procedure declaration does not match description of event having the same name.")

Private Sub txtCallerName_AfterUpdate(Cancel As Integer)
If IsNull(Me.txtCallDtTm) Or Me.txtCallDtTm = " " Then
Me.txtCallDtTm = Now()
End If
End Sub

----

Here is the code for the OnLoad and OnActivate events.

Private Sub Form_Load()
' 1 - Forces the form to be a "blank" on open.
' THEN
' 2 - Puts cursor in the txtCallerName textbox.

On Error GoTo Err_Form_Load

DoCmd.GoToRecord , , acNewRec ' 1
Me.txtCallerName.SetFocus ' 2

Exit_Form_Load:
Exit Sub

Err_Form_Load:
MsgBox Err.Description
Resume Exit_Form_Load

End Sub


Private Sub Form_Activate()
On Error GoTo Err_Form_Activate

DoCmd.Restore ' Restores form to actual size when it is activated.

Exit_Form_Activate:
Exit Sub

Err_Form_Activate:
MsgBox Err.Description
Resume Exit_Form_Activate

End Sub

-----

Any ideas?????????
 
Resolved problem

Resolved this problem by removing the afterupdate code.
 

Users who are viewing this thread

Back
Top Bottom