Trevor
03-10-2008, 12:56 PM
I am trying to execute an error message after controle update if, the button that is click is not the [update record] button. the [update record button does valdation for null fields on first click and updates on dblclick.
I have tried just above my error message if[update record].event.ondblclick <> true then [msg]
but I get an error that the method is not found and highlghts my .event or . dblclick . here is my code;
Is it posable to do this without inserting this code into every button I want this code to exicute on?
Dim LComments As Variant
If IDNumber <> "" Then
LComments = DLookup("[Comments]", "VMSU-CLT", "[IDNumber] = """ & IDNumber & """")
If Me.Comments <> LComments Then
Me.[Previous_Record_Button].Enabled = False
Me.[Next_Record_Button].Enabled = False
Me.[Find Record Button].Enabled = False
Me.[Print_Record_Button].Enabled = False
Me.[New Call Button].Enabled = False
Me.[Command107].Enabled = False
If Me.[Update Record].event.ondblclick <> True Then
MsgBox "You have attempted to update Comments, please click the 'Update Record' button" & _
"to continue or the 'Stop' Button to exit and go back to the Clip Board", vbInformation, _
"Update Attempted... "
Else: Me.[Previous_Record_Button].Enabled = True
Me.[Next_Record_Button].Enabled = True
Me.[Find Record Button].Enabled = True
Me.[Print_Record_Button].Enabled = True
Me.[New Call Button].Enabled = True
Me.[Command107].Enabled = True
End If
End If
End If
End Sub
I have tried just above my error message if[update record].event.ondblclick <> true then [msg]
but I get an error that the method is not found and highlghts my .event or . dblclick . here is my code;
Is it posable to do this without inserting this code into every button I want this code to exicute on?
Dim LComments As Variant
If IDNumber <> "" Then
LComments = DLookup("[Comments]", "VMSU-CLT", "[IDNumber] = """ & IDNumber & """")
If Me.Comments <> LComments Then
Me.[Previous_Record_Button].Enabled = False
Me.[Next_Record_Button].Enabled = False
Me.[Find Record Button].Enabled = False
Me.[Print_Record_Button].Enabled = False
Me.[New Call Button].Enabled = False
Me.[Command107].Enabled = False
If Me.[Update Record].event.ondblclick <> True Then
MsgBox "You have attempted to update Comments, please click the 'Update Record' button" & _
"to continue or the 'Stop' Button to exit and go back to the Clip Board", vbInformation, _
"Update Attempted... "
Else: Me.[Previous_Record_Button].Enabled = True
Me.[Next_Record_Button].Enabled = True
Me.[Find Record Button].Enabled = True
Me.[Print_Record_Button].Enabled = True
Me.[New Call Button].Enabled = True
Me.[Command107].Enabled = True
End If
End If
End If
End Sub