I am struggling to find a solution. I have a table that I log all my customer transactions (tbltransactions). This includes all invoices and payments, each being their own transaction record. When a customer sends me a check, they write the invoice number on it. What I am trying to do is create a lookup field on my tbltransactions form which I can enter the invoice number and it will search the transactions table and auto populate the clients name in the ClientID field on the form.
I can run the code without error. The Me.ClientID will equal the correct ClientID based of the Me.PaymentSearchBox, but ClientID field isn't showing any value in form view.
I can run the code without error. The Me.ClientID will equal the correct ClientID based of the Me.PaymentSearchBox, but ClientID field isn't showing any value in form view.
Code:
Private Sub frmtranbtnfindacct_Click()
If IsNull(Me.PaymentSearchBox) = False Then
Me.ClientID = DLookup("[ClientID]", "tbltransactions", "Invoice_no =" & Me.PaymentSearchBox)
Me.PaymentSearchBox = Null
If Me.Recordset.NoMatch Then
MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"
Me!txtInvoiceSearchBox = Null
End If
End If
End Sub