E
Emma
I have created a function that is supposed to let the user know that they
must enter data in a field before they move on to the next field. It is a
global function which I have put in a standard Module because I want to use
this on many forms in my database. However, when I try to execute, I get
"Compile Error: Expected: =". Can someone tell me what I am doing wrong?
Function Call:
Private Sub CS_Exit(Cancel As Integer)
func_FieldRequired (Me!CS.Text, Me!CS.Name)
End Sub
Function Code:
Public Function func_FieldRequired(FieldX As String, FieldXName As String)
If IsNull(FieldX) Then
'If it is empty popup appears
msgbox "You must fill in the " & FieldXName & "box.", , "Entry
Required"
'set focus back to Accounting_Reference_No field
Cancel = True
Me.FieldX.SetFocus
End If
End Function
Thank you!
must enter data in a field before they move on to the next field. It is a
global function which I have put in a standard Module because I want to use
this on many forms in my database. However, when I try to execute, I get
"Compile Error: Expected: =". Can someone tell me what I am doing wrong?
Function Call:
Private Sub CS_Exit(Cancel As Integer)
func_FieldRequired (Me!CS.Text, Me!CS.Name)
End Sub
Function Code:
Public Function func_FieldRequired(FieldX As String, FieldXName As String)
If IsNull(FieldX) Then
'If it is empty popup appears
msgbox "You must fill in the " & FieldXName & "box.", , "Entry
Required"
'set focus back to Accounting_Reference_No field
Cancel = True
Me.FieldX.SetFocus
End If
End Function
Thank you!