Updating a Text Box

Lory

New member
Local time
Today, 17:16
Joined
Mar 18, 2003
Messages
7
I know that a combo box can be updated using a query. But, is there any way to update a text box from a query?

What I would like to do is have that box filled in automatically based on the change of a combo box, but I cannot seem to make it work with a text box. I did it using a list box, but then I can't seem to reset the list box to blank. So I'm in a quandry!
 
Do you want to populate the text box with the Combo's first Column?

If so, on the AfterUpdate event of the combo put...

[MyTextBoxName]=[MyComboName]

For any other column other than the first, use....

[MyTextBoxName]=[MyComboName].Column(1) ' second column.

Note, Column 1 = 0 and so on..
 
What I want...

Actually,

I have a query that is based on what is selected in the combo box. I would like to update the text box with the result of that query if at all possible.
 
You mean populate the text box with the query result?

I take it there will always be ONE record returned?

Then simply use the DLookUp function on the query to populate the text box.

If more than one record will be returned then you are going to need a ListBox based on your combo query
 

Users who are viewing this thread

Back
Top Bottom