Combo Boxes

James.uk

Access Newbie
Local time
Today, 19:54
Joined
Apr 23, 2004
Messages
16
Hi, I'm new here and consider myself as a complete Access newbie.

I have a problem with a form that I created in design view with getting all the values in a field into a combo box for selection. I have no idea what I am doing at all, so this is just all trial and error. I apologise if this has been asked a million times before, I wasn't sure what to search for.

I have set up a form that will add data to a table (I will ask questions about this later), with a combo box and three textboxes. I would like to have the combo box populated with a list of names from one table, and then the form will add the data to another table. (I have the relationships set up and everything).

What I have Done

I created a query and used that as my data source for the form. It contains the name field from one table and the rest from the other. I then put as my control source for the combo box as the name field, but instead of populating it, it put each name on seperate records. For the purposes of this, the name field is the primary and foreign key, but I will be changing this to an autonumber when I work this one out.

I would prefer not to use VB for this, as I am sure it can be done without it (i.e. in properties).

Thanks for any input :)
 
Personally, I like forms and subforms for this type of simple function
MainForm is based on TableOne with your names.
ComboBox is used to find the record on the form.
SubForm is based on TableTwo with your three other textboxes.
Link Forms with your AutoNum field. (or for now, the name field if it is one single name field.)
 
Please could you please elaborate futher? I'm lost already. :confused:

For anyone else who is reading the thread, and can't be bothered to read or doesn't understand my explanation, here is a short version:

How do I populate a combo box on a form with all the values from a field?
 
LOL... okay, James, now I'M lost. What exactly are you trying to accomplish with the combo box? Are you using the combo box to find a particular record? If not, please explain what function you want the combo box to serve?
 
Pretty hard to explain, but I assume it isn't as complex as it sounds:

I have a form for adding records to a database. I want to show a foreign key (names) on the form in the form of a combo box (i.e. I want to list all the names so one can be selected for insertion into a different table).
 
No, it doesn't sound complicated at all.
Before you begin, make sure that the tables all have the field [ID] included and join the tables appropriately.

Step one:
Create your form based on your first table.
Step two:
Use the control wizard to create a combo box based on the same table. Be sure to include the primary key (ID) and choose the option, Go to a specific record on the form.

Step three:
Create a form based on your other table. Be sure to include the [ID] field.
Save that form.

Step four:
On your first form, insert a subform. Select the second form you just built as your subform. When it asks how you want to link the subform to the form, choose [ID] = [ID].

This way, the records on your main table will be shown on the first form, and by joining with a subform, you can add whatever information you please to the second table by way of the subform.
 
Thanks for your help Tess :)

I'll give it a go in a while and see what I can come up with. If I have any problems I'll post back.
 

Users who are viewing this thread

Back
Top Bottom