A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combo Box, Unbound Text Boxes



 
 
Thread Tools Display Modes
  #1  
Old November 2nd, 2009, 07:48 PM posted to microsoft.public.access.forms
chickalina
external usenet poster
 
Posts: 194
Default 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  
Old November 3rd, 2009, 12:51 AM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default 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  
Old November 3rd, 2009, 06:02 PM posted to microsoft.public.access.forms
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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  
Old November 3rd, 2009, 06:22 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:36 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.