Any help with this would be much appreciated.
I am trying to create a simple conditional statement to prevent the triggering of a append query if the value of the submitted textboxes are "" or null. I have the following code within the update button but I get the following error
" There is an invalid use of the . (dot) or ! operator or invalid parentheses"
Code as follows;
Private Sub B_LogEvent_Click()
On Error GoTo Err_B_LogEvent_Click
DoCmd.SetWarnings False
Dim stDocName As String
If (Forms![ACTIVITY].AddEvent = "") Then
MsgBox ("You need to enter the event details before logging the event")
Else
stDocName = "Q-Add-Event"
DoCmd.OpenQuery stDocName, acNormal, acEdit
End If
Exit_B_LogEvent_Click:
Me.Refresh
DoCmd.SetWarnings True
Exit Sub
Err_B_LogEvent_Click:
MsgBox Err.Description
Resume Exit_B_LogEvent_Click
End Sub
I know its the
If (Forms![ACTIVITY].AddEvent = "") Then
line causing the problem but cannot see what the issue is.