Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass SQL statement results to text box control 2

Status
Not open for further replies.

vttech

Technical User
Jan 28, 2006
297
US
I have a text box(txtUserLogon) on my form(frmLogInOut) that I would to have the following value

Code:
select empusername from tblEmployees where EmployeeID = forms!frmLogInOut!txtEmployeeID.value

I tried placing this in the control source and default value with no luck.
I created a query called qryUserName that is based on that sql statement but I can't figure how to pass that value on to the text box.


Any ideas or thoughts how to accomplish this goal??


Newbie in search of knowledge
 
Have a look at the DLookUp function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
How about...

=DLookup("empusername", "tblEmployees", "EmployeeID = " & forms!frmLogInOut!txtEmployeeID)


Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top