I have a command button which uses a macro to open a form for the user to enter an invoice. Here is the macro info: F_Invoice, Form, , , , Normal
Since I don't want the user to be able to open an invoice that had already been entered the query has a parameter of InvoiceDate = is null.
This works, in that the user can't access that invoice for editing. However, it shows a blank invoice. I would rather it show a message box saying something like "Invoice had been entered already"
I've been looking around on this forum and on google, and found something that may (or may not) work?:
If Dcount("*","queryB") = 0 Then
MsgBox "no data available"
Else
DoCmd.OpenForm "FormB"
End If
But I don't know where to place this? I'm probably going about this wrong . . . any direction would help!! Thank you.
Since I don't want the user to be able to open an invoice that had already been entered the query has a parameter of InvoiceDate = is null.
This works, in that the user can't access that invoice for editing. However, it shows a blank invoice. I would rather it show a message box saying something like "Invoice had been entered already"
I've been looking around on this forum and on google, and found something that may (or may not) work?:
If Dcount("*","queryB") = 0 Then
MsgBox "no data available"
Else
DoCmd.OpenForm "FormB"
End If
But I don't know where to place this? I'm probably going about this wrong . . . any direction would help!! Thank you.
Last edited: