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

Autofill Text Boxes from Choice in Combo Box - Phone Numbers

Status
Not open for further replies.

dshannon

Technical User
May 25, 2002
11
US

I have a combo box with a list (Architectural_Firm). I have a telephone (Arch_Telephone) and a fax (Arch_Facsimile) text box. I would like each of them to autofill when the User chooses the Architect from the combo box. My form is based on a query.

I have tried at least four different methods, based on the wonderful responses in this forum, but none have worked. I will preface by saying that my text box name and caption name are the same. Does this matter. Oh, and the telephone numbers are masked to be phone numbers.

Please help. :)

Dianne in Virginia
 
Dianne,

Populate the list box with all the data you need in hidden columns. Then have an on change event on the combobox to pass the data back.....

So.....

In your combobox you need 3 columns, one for architect, one for phone and one for fax....

And the change event should look like...

txtTel = cboArchitect.Column(1,cboArchitect.ListIndex))
txtFax = cboArchitect.Column(2,cboArchitect.ListIndex))

That helps?

Craig
 
Craig, thank you for responding so quickly.

I tried your suggestion. Please look at this and tell me I substituted the right items.

Arch_Telephone = telephone number text box
Arch_Facsimile = fax number text box
Architectural_Firm = Architect
MasterQuery = name of Query form is reading from
MasterTable = name of Table query is reading from

txtArch_Telephone = cboArchictectural_Firm.Column(4,cboMasterTable.ListIndex)
txtArch_Facsimile = cboArchitectural_Firm.Column(4,cboMasterTable.ListIndex)

When this didn't work, I changed the MasterTable to MasterQuery. Please tell me what dumb thing I am doing wrong. :)

Dianne in Virginia
 
Nearly, Dianne....

The rowsource i'm referring to is the one filling the combo box, not the form........so all the data needs to be in the combo box........

And secondly, the column number you're referring to in both cases are the same.....this will drag thru the wrong data into one of the fields....

Craig

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top