Assigning variables

barboza

Registered User.
Local time
Today, 17:32
Joined
Aug 22, 2007
Messages
23
We have two tables - Custody Log and Client

We have a form with two fields that has been created from the Custody Log Table. The first field is a textbox where you type in a client number (txtClntNum), the other is the Client Field.

We want txtClntNum_AfterUpdate() sub to get the corresponding client name from the client table, and automatically insert the client name in the client field of my form.

Thanks.
 
Take a look at this artiicle from Microsoft barboza. It is one of the good ones I've picked up on my searches....

http://support.microsoft.com/kb/319482/en-us

For what you are trying to do, I wonder if something like this work....
Code:
Private Sub txtClntNum_AfterUpdate()
  
  If Len(txtClntNum) > 0 Then
    Me!ClntName.Rowsource = "SELECT ClntName & _ 
    FROM [table] WHERE ClntNum = Me.txtClntNum"
  Else

End If

End Sub

I think a combo box would be better here, if you could go about it that way.
 

Users who are viewing this thread

Back
Top Bottom