Hi all,
I'm pretty sure this has been answered before, but I can't seem to come up with the right "keywords" to find it.
I have a button on my form that when pressed, asks the user to input the Work Order number they are looking for. The form (based on a query) then opens to that specific Work Order.
What I want to do is if the user inputs a Work Order number that does not exist, they will get an error message.
Right now, my code is this:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "WODeleteForm"
DoCmd.OpenForm stDocName, , , stLinkCriteria
If DCount("[Work Order]", "qryWODelete"
= 0 Then
MsgBox ("That Work Order Number Does Not Exist"
Exit Sub
End If
When I run it, I get the error message "You Canceled the Previous Operation".
Does anybody know what I'm doing wrong?
Thank you in advance.
I'm pretty sure this has been answered before, but I can't seem to come up with the right "keywords" to find it.
I have a button on my form that when pressed, asks the user to input the Work Order number they are looking for. The form (based on a query) then opens to that specific Work Order.
What I want to do is if the user inputs a Work Order number that does not exist, they will get an error message.
Right now, my code is this:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "WODeleteForm"
DoCmd.OpenForm stDocName, , , stLinkCriteria
If DCount("[Work Order]", "qryWODelete"
MsgBox ("That Work Order Number Does Not Exist"
Exit Sub
End If
When I run it, I get the error message "You Canceled the Previous Operation".
Does anybody know what I'm doing wrong?
Thank you in advance.