Combo Box, Unbound Text Boxes

C

chickalina

I have a form that has a Combo Box for Contractor. The form works alright
filling in the unbound text boxes with the first name, address, city, state,
etc... after the last name is chosen in the combo box (last name =column2,
first name=column 3). When I navigate away from the form, only the last name
shows in the combo box when you return to the form. If I remove the Control
Source, then choose a Contractor, it remains the same Contractor for all
contracts (or records).

This is what I'm using to fill in the text boxes:
Me!Text18 = Me!Combo35.Column(3)

I haven't gone with any descriptive names until I get the form to work.
Please help.
Thank you!
 
J

Jeff Boyce

If those unbound textboxes are unbound, that means there's no table storing
those values... and that's as it should be. If you already have the
information stored in the table you are using to feed the combobox, you
really don't need/want to re-store the same information elsewhere.

So it sounds like you're saying that you'd like the form to display those
other pieces of information if there's been a (previous) selection made in
the combobox.

One way to do this would be to put something like the following (untested)
code in the OnCurrent event for the form:

Call Combo35_AfterUpdate

This assumes that you have a procedure in the AfterUpdate event of that
combobox that "loads" the textboxes...

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or psuedocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
K

KARL DEWEY

Forms do not store data. You have to use bound text boxes to store the
information in a table.
 
B

BruceM via AccessMonster.com

Where is that code? For it to work as you wish you need to have it in the
Combo35 After Update event and the form's Current event.

Alternatively, set the Control Source of a text box to:

=[Combo35].Column(3)

Another option would be to display the address, etc. information in a subform
based on the Contractor table. Assuming ContractorID is the primary key of
the Contractor table and that it is the stored value in the contractor field
of whatever table you are working with, the Link Master and Link Child
properties of the subform control would be ContractorID. You can lock the
subform so data can only be read, not edited.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top