I have a search form and the user has to select a case ref before clicking an action.
if they don't select a case it throws up an error so i'm trying to put in some error handling.
this is what i have, but it deosnt seem to be doing the job, please can someone let me know where im going wrong, i'm sure its something really simple:
Thanks
if they don't select a case it throws up an error so i'm trying to put in some error handling.
this is what i have, but it deosnt seem to be doing the job, please can someone let me know where im going wrong, i'm sure its something really simple:
Code:
Private Sub Command5_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmUpdateCaseStep2"
stLinkCriteria = "[ID]=" & Me![SearchResults]
If stLinkCriteria = "" Or Null Then
Dim iRet As Integer
Dim strPrompt As String
Dim strTitle As String
' Promt
strPrompt = "Please select a client first"
' Dialog's Title
strTitle = "Oops"
'Display MessageBox
iRet = MsgBox(strPrompt, vbOKOnly, strTitle)
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmUpdateCaseStep1", acSaveYes
End If
End Sub
Thanks