G
Guest
Good morning
I'm struggling on an unbound form that checks for the prior entry of an Invoice. If the Invoice exists (for a given Purchase Order - I don't have the 2nd condition in yet since I'm troubleshooting this. I can put that in later), I have a msgbox and want the value to stay in the textbox, but for it to regain the focus. Here's what I have so far
Public Sub InvoiceNumber_Exit(Cancel As Integer
Dim invoicecount As Varian
invoicecount = DCount("[InvoiceNumber]", "T_Invoice", "InvoiceNumber = Forms!F_16!InvoiceNumber"
If invoicecount <> 0 The
MsgBox ("That Invoice already exists for PO#: " & Left(PONumber, 4) & "-" & Right(PONumber, 4) & Chr$(10) & " Please verify it and reenter"
DoCmd.GoToControl "InvoiceNumber
End I
End Su
Public Sub Payment_Enter(
Dim invoicecount As Varian
If invoicecount <> 0 Then InvoiceNumber.SetFocu
End Su
Can someone please help me out
Thank you in advance
Derek
I'm struggling on an unbound form that checks for the prior entry of an Invoice. If the Invoice exists (for a given Purchase Order - I don't have the 2nd condition in yet since I'm troubleshooting this. I can put that in later), I have a msgbox and want the value to stay in the textbox, but for it to regain the focus. Here's what I have so far
Public Sub InvoiceNumber_Exit(Cancel As Integer
Dim invoicecount As Varian
invoicecount = DCount("[InvoiceNumber]", "T_Invoice", "InvoiceNumber = Forms!F_16!InvoiceNumber"
If invoicecount <> 0 The
MsgBox ("That Invoice already exists for PO#: " & Left(PONumber, 4) & "-" & Right(PONumber, 4) & Chr$(10) & " Please verify it and reenter"
DoCmd.GoToControl "InvoiceNumber
End I
End Su
Public Sub Payment_Enter(
Dim invoicecount As Varian
If invoicecount <> 0 Then InvoiceNumber.SetFocu
End Su
Can someone please help me out
Thank you in advance
Derek