Hamish 237
New member
- Local time
- Tomorrow, 00:03
- Joined
- Jun 19, 2019
- Messages
- 16
Hi Have a small issue with a command button it works fine and gives the desired message if there is no content in the referenced control but the message box changes to a syntax error warning if the button is pressed a second time without data in the control is there and easy code line to reset this warning msgbox
Private Sub OPTOSO_Click()
On Error GoTo Err_OPTOSO_Click
'Open the form List using the data in SOTV text box selection to filter the records
If IsNull([SOTV]) = True Then
MsgBox ("Please Enter Sales order number to search for")
Else
DoCmd.OpenForm "list", acNormal, , "[Sord] = " & [SOTV], acFormEdit
End If
[SOTV].Value = ""
Exit_OPTOSO_Click:
Exit Sub
Err_OPTOSO_Click:
MsgBox Err.Description
Resume Exit_OPTOSO_Click
End Sub
Any help / suggestions would be appreciated
Private Sub OPTOSO_Click()
On Error GoTo Err_OPTOSO_Click
'Open the form List using the data in SOTV text box selection to filter the records
If IsNull([SOTV]) = True Then
MsgBox ("Please Enter Sales order number to search for")
Else
DoCmd.OpenForm "list", acNormal, , "[Sord] = " & [SOTV], acFormEdit
End If
[SOTV].Value = ""
Exit_OPTOSO_Click:
Exit Sub
Err_OPTOSO_Click:
MsgBox Err.Description
Resume Exit_OPTOSO_Click
End Sub
Any help / suggestions would be appreciated