If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Combo Box, Unbound Text Boxes
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! |
#2
|
|||
|
|||
Combo Box, Unbound Text Boxes
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. "chickalina" wrote in message news 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! |
#3
|
|||
|
|||
Combo Box, Unbound Text Boxes
Forms do not store data. You have to use bound text boxes to store the
information in a table. -- Build a little, test a little. "chickalina" wrote: 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! |
#4
|
|||
|
|||
Combo Box, Unbound Text Boxes
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. chickalina wrote: 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! -- Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|