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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a Text Box's Default Value as a Query Result

Status
Not open for further replies.

iamedwardkim

IS-IT--Management
Nov 7, 2002
29
US
I am able to set a combo box's row source as the return values from a query. However, I am trying to set the default value of a text box as the result of a query, where I know only one value will be returned, and I am unable to do so. Can someone please help? Thank you.
 
I would place the following code in your form's On_Current event, that way it will enter the default value each time it finds a null text box.


if isnull(MyTextBox) then 'assign default
MyTextbox = dlookup("DefaultValue", "Myquery")
end if

HTH

Rich



Lead Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top