Help with Combo Boxes

beanie_d83

Registered User.
Local time
Today, 22:24
Joined
Feb 5, 2013
Messages
29
Hi all,

Can anyone help me with combo boxes?

I have a form which I am using as a Build Form to create specifications for trailers that we manufacture. I need the combo box to look up data from one table and then place it into another table which will hold all the specification details for each trailer.

Should this be a fairly basic thing to achieve? I've checked the row source and this is pulling the data I need and from the right table, but getting it to place this data into another table is proving to be tricky.

Any help would be greatly appreciated
 
Do you have relationships already setup between the two tables?

If so you could click Design on form, then click Add Existing Field, then click on Show all Tables, and then add the location you want it to go to. then add the source to achieve the drop down.


Hope this helps!
 
Hi Ryker,

there isn't a relationship between these tables no as I am using a field in the first table purely as a lookup to populate a field in the second.

I had to go about it this way because initially I had max'd out the amount of indexes allowed per table (I think it's 32) so after a bit of research I realized relationships weren't required if the table field is used on a lookup basis only.

I appreciate your response however, so I thank you for taking the time to reply to my post
 
That is correct. It sounded like you built the form off that.

What is setup under Control Source on the combobox?

Also, are you using the combobox wizard? you should be able to setup the query based pull from there, then at the end select where that data goes.
 
This is where I'm getting confused, there is a drop down arrow where I would assume a list of tables should be but the list is empty. The only other thing I have available to me here is the expression builder but I'm not sure what to do with this.
 
Under Design view, open up the property sheet. Click on the combobox you want to use, and then select Data.

you should see:
Control Source
Row Source
Row Source Type
etc..
etc..

Control Source = where the data is saved to
Row Source = where query is pulled from, or manually typed in>
Row Source Type = value list = manually typed in, Table/Query = pulled from table.

If you can zip the file and upload it and ill take a look at it.
 
Right now it looks like all you are trying to pull is the Dealer_Name?

Is this the only thing you want to query and save to another table?
 
No there will be other fields I will want to pull through but from different lookup tables.

I was hoping that once I figured out how to get the first combo box up and running the way I need it to then the rest should follow suit?

For example, the dealer will place an order for a particular size of trailer. There are several different options available like what style of bulkhead sheet they would like, would they like a window set into it or what wheel size/type is needed...and so on.
 
Take a look at this, it will add it now, however you will need to setup the others before it will work properly due to the relationships and the requirements of the primary keys being needed.
 

Attachments

Ok I see what you have done! So does this mean if I want a combo box to just look up data from other tables, a relationship has to be in place between them as this was partly the issue I had before when I had too many relationships causing the indexes to max out?

Thank you so much for your help, I am so pleased that I can now move passed this obstacle as I was getting ready to give up on it but turns out the answer was staring me right in the face!
 
Yea, I think the relationships you have could be consolidated, but unsure how exactly they relate.

Wish you the best... lol im still trying to get past my roadblock!
 
No Relationships are not necessary at all. A combo box recordsource can be a completely unique query with any joins (relationships) you care to create.
 
May I ask what else you did to get the combo box control source list to appear? I tried to do it myself by changing the relationships as you have but the list still does not appear for me to select the field to be populated.
 
No Relationships are not necessary at all. A combo box recordsource can be a completely unique query with any joins (relationships) you care to create.

Could you explain how to go about making a query to achieve this please?
 
Click Design
Click Add Existing Fields
Click on the table you want, then right click and click edit record source.

This gives you the query builder to add them.

If you plan on using multiple tables you will need to use subforms, from what I have found.


Someone may have a better method, but currently that's what I have been doing.
 
Once you have the query builder open you can bring in another table if required and simply join it on any matching Primary Key field or Foreign key field depending on the nature of your data. No need for any sub forms etc.

Select the data fields you need to appear in your combo box and set up the number of columns to match and away you go. If you want to hide an ugly ID field and present a name set the column width to 0; in the list of column width property.
 

Users who are viewing this thread

Back
Top Bottom