Noreene Patrick
Registered User.
- Local time
- Today, 07:00
- Joined
- Jul 18, 2002
- Messages
- 223
I have a form that pulls from a table that holds Invoice #'s. I used the wizard to make a combobox to type in the info I want and it pulls up the correct invoice number. That works fine. But, when I enter an invoice number that is not in the table, it does nothing...I want it to pop up a MsgBox that says "Please enter a valid invoice number."
Below is the code that the wizard wrote for me..but exactly how do I add the correct code for the msgbox to work?
The last line of code is what I put in but it always pops up even if the invoice number is correct.
Private Sub Combo72_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[tblInvoice#] = " & Str(Nz(Me![Combo72], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
MsgBox "Please enter a valid invoice number."
End Sub
Thanks, Noreene
Below is the code that the wizard wrote for me..but exactly how do I add the correct code for the msgbox to work?
The last line of code is what I put in but it always pops up even if the invoice number is correct.
Private Sub Combo72_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[tblInvoice#] = " & Str(Nz(Me![Combo72], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
MsgBox "Please enter a valid invoice number."
End Sub
Thanks, Noreene