Getting value into a text box

bobby

Registered User.
Local time
Today, 23:21
Joined
Apr 29, 2004
Messages
28
Guys i have a form and i need to set the value within a textbox or label to the value from a table using an sql select statement.

I can get the value into a combo box using rowsource, but i need it either in a Textbox or Label.

I dont want to use vba, because its for uni assignment. The only vba code ill use really is just requeriies.

Any ideas please ?
 
insert the following into the Text box Control Source and change the field name and table names accordingly:
Code:
=Nz(DLookup("[FieldName]", "[TableName]", "[ID]=1"),"")
replace the [ID]=1 with whatever WHERE criteria you want to use or remove it to return the first record in the table. The Nz function with handle a NULL return value and change it to an empty string so you don't get an error.
 

Users who are viewing this thread

Back
Top Bottom