I have posted this problem in the forms section but am still unable to resolve it so i thought i would try it here,
I have an input box that asks for a works order number this then opens the relevant record for that number, but if a number is entered that doesn't exist then it opens a new record. So how can i get it to say "the number does not exist"
here is the code that i am using
Private Sub cmdOpenRec_Click()
Dim strWorksOrderNumber As String, strFilter As String
strWorksOrderNumber = InputBox("Please Enter W/O Number"
If strWorksOrderNumber = "" Then
GoTo Exit_This_Sub
End If
strFilter = "[WorksOrderNumber] = " & Trim(Str(strWorksOrderNumber))
DoCmd.OpenForm "frmAdmin", acNormal, , strFilter
Exit_This_Sub:
Exit Sub
End Sub
If i remove the goto statement and insert a messagebox when i enter no data the message box appears but not if i insert a works order number that doesn't exist
Any help would be appreciated
Thanks CJB
I have an input box that asks for a works order number this then opens the relevant record for that number, but if a number is entered that doesn't exist then it opens a new record. So how can i get it to say "the number does not exist"
here is the code that i am using
Private Sub cmdOpenRec_Click()
Dim strWorksOrderNumber As String, strFilter As String
strWorksOrderNumber = InputBox("Please Enter W/O Number"
If strWorksOrderNumber = "" Then
GoTo Exit_This_Sub
End If
strFilter = "[WorksOrderNumber] = " & Trim(Str(strWorksOrderNumber))
DoCmd.OpenForm "frmAdmin", acNormal, , strFilter
Exit_This_Sub:
Exit Sub
End Sub
If i remove the goto statement and insert a messagebox when i enter no data the message box appears but not if i insert a works order number that doesn't exist
Any help would be appreciated
Thanks CJB