Good day,
I have a form (CSearch) to input data and search for records in a query and displays it on a subform (CAff) once a search button is clicked.
I have a current event on the subform that check if the field "CONTRACTSTATUS " is "Expired" and if so gives a message box saying "This contract is expired"
This works when the main form has been loaded already, but whenever I re-open the form I get error 2424 "The expression you entered..."
Can you help me? Here is the code I'm using:
I have a form (CSearch) to input data and search for records in a query and displays it on a subform (CAff) once a search button is clicked.
I have a current event on the subform that check if the field "CONTRACTSTATUS " is "Expired" and if so gives a message box saying "This contract is expired"
This works when the main form has been loaded already, but whenever I re-open the form I get error 2424 "The expression you entered..."
Can you help me? Here is the code I'm using:
Code:
Private Sub Form_Current() If Me.NewRecord Then Me!CONTRACTSTATUS.Visible = True End If If Me.CONTRACTSTATUS.Value = "EXPIRED" Then MsgBox ("This contract is expired") Else Me!CONTRACTSTATUS.Visible = False Exit Sub End If End Sub
Comment