We have created a form from our custody table called frmCustody.
The form has a text box called - txtClntNum
and a field called client.
I have the following statement:
Option Compare Database
Dim strLabID As Long, strClient As String
Private Sub txtClntNum_AfterUpdate()
strClient = "Select [ClientName] from Clients where [ClientNum] = txtClntNum"
[CLIENT] = strClient
End Sub
ClientName is the client's name stored in a table called Clients.
ClientNum is the client number as stored in the Clients table.
The idea is to enter the clients identification number (txtClntnum), and have the correct client found in the Clients table. Once the client is found we want to store the clients name in strClient, and then have it appear in the client field in frmCustody.
The only thing that ever shows up in the client field is whatever is in quotes after strClient =
It seems the statement is never evaluated.
Any help would be greatly appreciated.
Thanks
The form has a text box called - txtClntNum
and a field called client.
I have the following statement:
Option Compare Database
Dim strLabID As Long, strClient As String
Private Sub txtClntNum_AfterUpdate()
strClient = "Select [ClientName] from Clients where [ClientNum] = txtClntNum"
[CLIENT] = strClient
End Sub
ClientName is the client's name stored in a table called Clients.
ClientNum is the client number as stored in the Clients table.
The idea is to enter the clients identification number (txtClntnum), and have the correct client found in the Clients table. Once the client is found we want to store the clients name in strClient, and then have it appear in the client field in frmCustody.
The only thing that ever shows up in the client field is whatever is in quotes after strClient =
It seems the statement is never evaluated.
Any help would be greatly appreciated.
Thanks