Auto-populate fields based on one selection

MrMacs

New member
Local time
Yesterday, 19:29
Joined
Dec 12, 2012
Messages
6
I have found some similar posts on this but nothing that I can get working on my end. I feel like :banghead: at this point because I'm sure it's something easy I'm missing. I'm still somewhat new to the more advanced Access stuff so please be gentle... :o

I have one query that creates a list of all relevant customer information (account#, name, ownership type, contact, etc) from two tables. What I'm trying to do with this is create a form that, when the account number is selected (combo-box) or entered in, the rest of the fields will automatically update with the corresponding information for that account.

Right now I have it so that I can change the account number, but it doesn't update the rest of the account information.

Any help is greatly appreciated.
 
I assume the rest of the fields will be textboxes? If so, base your account# combo on the query, and then in the control source of the textboxes, enter something like:
=[comboname].column(X)
 
Maybe I'm doing something wrong but that doesn't seem to work. Just to make sure I started from scratch with a new form in Access 2010.

I opened the query I'm pulling all the data from and hit the form button which creates a new one based on all the fields in the query. I changed the AcctNbr field to a combobox. Then I went to the BusName textbox and changed the Control Source from "BusName" to "=AcctNbr.column3". After doing that the value changes to "#Name?".

Obviously I'm doing something wrong but I can't see what it is. As you can tell, I'm new to forms in access. Previously I was just using it for tables and queries.
 
What is the column count in the properties of your combo box?
 
Ah ha! That was the problem. The column count was "1". Once I changed it to 13 and updated all the other fields with your previous comment, it worked like a charm.

I noticed however that now when I select the combobox, it lists all the columns. Is there a way to just show the AcctNbr field in the combobox without showing all the additional columns?
 
Just change the column widths to 5cm;0cm;0cm....etc

Obviously the 5cm width is the one you want to see.
 

Users who are viewing this thread

Back
Top Bottom