Error Message - Please Help

  • Thread starter Terrence Carroll
  • Start date
T

Terrence Carroll

Can you please help with the following error message I get each time a user
updates the check box on a form that I have. I have a field that upon the
after update events of a couple of checkbox controls is supposed to update to
the current date if the checkbox is selected. I am getting an error message
indicate the following:

"The expression After Update you entered as the event property serrting
produced the following error: Object or class does not support the set of
events."

* The expression may not result in the name of a macro, the name of a user
defined function, or [Event Procedure].
*There may have been an error in evaluating the function, event, or macro

Listed below is the code I have tied to each event:

Private Sub Resolved_Status_AfterUpdate()
If Resolved_Status = True Then
Resolved_Date = Now()
Else
Resolved_Date = Null
End If
End Sub

Private Sub Timesheet_Missing_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub Hours_Match_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub VMS_OT_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub


Private Sub VMS_Reg_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub MJ_Reg_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub MJ_OT_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub
 
T

Terrence Carroll

Another strange thing is that when I open the database, and open the form in
design view go to the VB code for the checkboxes and then close out of the
code and re-open the form the code seems to run fine without an error
message. However when I initally open the database up and go to the
form/subform from the switchboard without going into the code via design view
of the subform, I get the error messages.

Terrence Carroll said:
Can you please help with the following error message I get each time a user
updates the check box on a form that I have. I have a field that upon the
after update events of a couple of checkbox controls is supposed to update to
the current date if the checkbox is selected. I am getting an error message
indicate the following:

"The expression After Update you entered as the event property serrting
produced the following error: Object or class does not support the set of
events."

* The expression may not result in the name of a macro, the name of a user
defined function, or [Event Procedure].
*There may have been an error in evaluating the function, event, or macro

Listed below is the code I have tied to each event:

Private Sub Resolved_Status_AfterUpdate()
If Resolved_Status = True Then
Resolved_Date = Now()
Else
Resolved_Date = Null
End If
End Sub

Private Sub Timesheet_Missing_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub Hours_Match_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub VMS_OT_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub


Private Sub VMS_Reg_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub MJ_Reg_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub MJ_OT_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub
 
J

Jerry Whittle

Two things come to mind:

1. With the VB window open, have you gone up to Debug, Compile? Any error
messages.

2. While in the VB window, go to the Immediate window and type in the
following:

Debug.Print Now()

Then hit the Enter key. Any errors? Does the proper time show up?
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Terrence Carroll said:
Another strange thing is that when I open the database, and open the form in
design view go to the VB code for the checkboxes and then close out of the
code and re-open the form the code seems to run fine without an error
message. However when I initally open the database up and go to the
form/subform from the switchboard without going into the code via design view
of the subform, I get the error messages.

Terrence Carroll said:
Can you please help with the following error message I get each time a user
updates the check box on a form that I have. I have a field that upon the
after update events of a couple of checkbox controls is supposed to update to
the current date if the checkbox is selected. I am getting an error message
indicate the following:

"The expression After Update you entered as the event property serrting
produced the following error: Object or class does not support the set of
events."

* The expression may not result in the name of a macro, the name of a user
defined function, or [Event Procedure].
*There may have been an error in evaluating the function, event, or macro

Listed below is the code I have tied to each event:

Private Sub Resolved_Status_AfterUpdate()
If Resolved_Status = True Then
Resolved_Date = Now()
Else
Resolved_Date = Null
End If
End Sub

Private Sub Timesheet_Missing_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub Hours_Match_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub VMS_OT_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub


Private Sub VMS_Reg_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub MJ_Reg_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub

Private Sub MJ_OT_Hours_AfterUpdate()
Me.Audit_Date = Null
If Me.Hours_Match = True Then
Me.Audit_Date = Now()
ElseIf Me.Timesheet_Missing = True Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.VMS_OT_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_Reg_Hours) Then
Me.Audit_Date = Now()
ElseIf Not IsNull(Me.MJ_OT_Hours) Then
Me.Audit_Date = Now()
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top