Auto fill fields

B

Brent

I need a textbox to auto fill based on what is selected in a combo box. My
combo box is called Program and my textbox is called Company. Each Program
has a specific company number. When a program is selected in the combo box I
need the company text box to auto fill with its related company number. I
have read the other posts and still cant get it to work. It would be the
same to me if I could do this in the table instead of on the form. Either
way, I just need the company number to end up in the table and don't want to
have to enter it over and over when I am already entering Programs. Thanks
in advance for any help.
 
A

AlCamp

Brent,
So... CompanyNo should be "related" to Program...
In the query behind your combo box, place the CompanyNo in the 2nd
column. Then, when a user selects a Program from the combo (using the combo
AfterUpdate event), run this code...
[Company] = YourComboName.Column(1)
Combo columns are numbered 0,1,2, etc.. so the 2nd column with the
ComanyNo is .column(1).
hth
Al Camp
 
B

Brent

Got it. Thanks a bunch.

AlCamp said:
Brent,
So... CompanyNo should be "related" to Program...
In the query behind your combo box, place the CompanyNo in the 2nd
column. Then, when a user selects a Program from the combo (using the combo
AfterUpdate event), run this code...
[Company] = YourComboName.Column(1)
Combo columns are numbered 0,1,2, etc.. so the 2nd column with the
ComanyNo is .column(1).
hth
Al Camp

Brent said:
I need a textbox to auto fill based on what is selected in a combo box. My
combo box is called Program and my textbox is called Company. Each
Program
has a specific company number. When a program is selected in the combo
box I
need the company text box to auto fill with its related company number. I
have read the other posts and still cant get it to work. It would be the
same to me if I could do this in the table instead of on the form. Either
way, I just need the company number to end up in the table and don't want
to
have to enter it over and over when I am already entering Programs.
Thanks
in advance for any help.
 
B

Brent

Acctually it isn't working. I thought it was, but it isn't. Any ideas why?

Brent said:
Got it. Thanks a bunch.

AlCamp said:
Brent,
So... CompanyNo should be "related" to Program...
In the query behind your combo box, place the CompanyNo in the 2nd
column. Then, when a user selects a Program from the combo (using the combo
AfterUpdate event), run this code...
[Company] = YourComboName.Column(1)
Combo columns are numbered 0,1,2, etc.. so the 2nd column with the
ComanyNo is .column(1).
hth
Al Camp

Brent said:
I need a textbox to auto fill based on what is selected in a combo box. My
combo box is called Program and my textbox is called Company. Each
Program
has a specific company number. When a program is selected in the combo
box I
need the company text box to auto fill with its related company number. I
have read the other posts and still cant get it to work. It would be the
same to me if I could do this in the table instead of on the form. Either
way, I just need the company number to end up in the table and don't want
to
have to enter it over and over when I am already entering Programs.
Thanks
in advance for any help.
 
Top