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

Combo Box to Text Box

Status
Not open for further replies.

Tech1961

MIS
Sep 30, 2002
7
0
0
US
I have a form that mainly uses table1.

A combo box use field1 of query from table2.

I want field2 of query from table2 to show on another text box as soon as making selection from combo box.

How do you do that?
 
In your query of table2 show both fields that you want on the form. Then in the attributes of the combo box make sure the you have 2 columns. You can have the second column have a length of 0", this will hide the second column when the combo box has focus.

Create an event procedure for when the combo box is clicked. Then use the following examble:
Field2 (of Table 1) = field2.column(1) (This is the combo box)

Hopefully this will help you.
 
TCVance,

I'm getting a Microsoft Visual Basic Error. The error is

Run-time error '424':
Object required

Here is what I got to make it simple.

Table1 FieldA FieldB FieldC FieldD
Table2 Field1 Field2

Query1 SELECT Table2.Field1, Table2.Field2
FROM Table2;

Form FieldA FieldB FieldC FieldD
(FieldC is a Combo Box using Query1 Table2.Field1)
I want Field2 of Query1 to go to Table1.FieldD as soon as I select from Combo Box.
[Event Procedure]
Private Sub C_BeforeUpdate(Cancel As Integer)
FieldD = Field2.Column(2)
End Sub

-----------------
Any suggestions?

Thank you all...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top