Auto Populate Text Box

Dannyboy11

Registered User.
Local time
Today, 04:33
Joined
Jul 1, 2010
Messages
58
Hi

On my form, how am I able to do the following:
Type a value into a text box a
Lookup this value from a table
Return what is found in column 2 into textbox b

It sounds like it should be simple but I am only a novice and do not know how to do this. Any help would be appreciated

Many thanks
 
The syntax varies according to the Datatype of the unique field that you're using to retrieve the second bit of data. In this example, the field being populated by the user and used to 'pull' the other data is EmpID, and the field being used to populate the second Textbox is Wage.
Where EmpID is Numeric
Code:
Private Sub EmpID_AfterUpdate()
 Me.Wage = DLookup("wage", "Employees", "[EmpID] = " & Me.EmpID)
End Sub
Where EmpID is Text
Code:
Private Sub EmpID_AfterUpdate()
 Me.Wage = DLookup("Wage", "Employees", "[EmpID] = '" & Me.EmpID & "'")
End Sub
Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom