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!

putting the result of a select with single rown in a field in form. 2

Status
Not open for further replies.

barny2006

MIS
Mar 30, 2006
521
US
hi folks.
i have an access form that usese fields of a database. in one of the form fields, i have to pull the data from another table using a select statement. my question is, how do i put the result of this select into a host variable (the form field). the sql return ok with a single row of data item. can anybody help?
 
You may consider 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
 
thanks phv. you're good! it worked like a charm. actually, i didn't have to dbconnect or anything. just put the function on the form. the field on the form turned out to be like this. it took a while, but i figured it out.

=DLookUp("[usual_fee]", "dental_tbl","[dentist_name] = " & Forms![app_form]![combo107])
thanks again.
 
i have one issue here. i have a calculated field on the form:
like this: the name of the field is text99: the control source of the form field, text99 is:
=int(text121) + int(text133)
which adds the contents of two fields (text121 and 133 and displays the result in text 99). how would i put this in a table column. the column name is total_fees. the result of the calc is properly displayed on the form, but i'm trying to find a way to place this result in the table column.
any suggestions?
 
thanks.
it worked. i had to (like you said) to bound the calculated result text box to a field in the database. and do the calculation via a event procedure in vba.
thanks to you and phv.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top