I have a textbox on a form that I use to search for invoices. When I enter an invoice number and press the search button, an invoice form opens but does not contain any data. The invoice number is in the invoice table.
Here is my code:
InvoiceNumber is a text data type and is not the primary key.
Any suggestions as to why a blank form opens?
Thanks
Here is my code:
Code:
rivate Sub cmdInvoiceSearch_Click()
Dim strDocName As String
Dim strLinkCriteria As String
strDocName = "frmInvoice"
If Len(Trim$(Me!txtInvoiceSearch & vbNullString)) = 0 Then
MsgBox "Nothing Entered. Please Enter Some Value."
Me.txtInvoiceSearch.SetFocus
Else
strLinkCriteria = "[InvoiceNumber]= ' " & Me![txtInvoiceSearch] & "'"
DoCmd.Close acForm, "frmOasisStart"
DoCmd.OpenForm strDocName, , , strLinkCriteria, , , "frmOasisStart"
End If
End Sub
InvoiceNumber is a text data type and is not the primary key.
Any suggestions as to why a blank form opens?
Thanks