Select name from a combobox in form to add ID to table (1 Viewer)

platypusfeet

New member
Local time
Today, 03:49
Joined
Nov 14, 2018
Messages
8
Hi - I apologize that this is a very basic question that has already been answered, but I cannot find the answer anywhere. I am new to Access and need a bit of a play-by-play for this particular question in order to start really making progress.

I have a table full of "risk items". Each "item" can belong to a number of categories. For example, each "item" can apply to a specific "project".

So I have my "risk items" table that I want to add new records to. I also have a table for projects with "project name" and a unique project key ID. In the risk items table, I have a column for the project key ID (and I've already established the one-to-many relationship).

I want to use a form with a combo-box to specify which project the item applies to. I only want to be able to choose projects that are already included in the project table (so the project table will not be edited). I want to be able to choose the project name from the drop down and then have the form save the corresponding project key ID to the risk item table.

So my two tables are:
RISK ITEMS
- Project ID (number) [one-to-many relationship]
- Item Information (string)

PROJECTS
- Project Key ID (number) [one-to-many relationship]
- Project Name (string)

In my form I want to be able to see and choose from a list of Project Names (string; PROJECTS TABLE) to add the corresponding Project Key ID (number; PROJECTS TABLE) to the Project ID column (number; RISK ITEMS TABLE).

I know that I need to use a query, but I can't figure it out. Thank you in advance!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:49
Joined
Aug 30, 2003
Messages
36,115
Have you tried the combo box wizard? It should lead you through that process (the form would be bound to the risk items table).
 

platypusfeet

New member
Local time
Today, 03:49
Joined
Nov 14, 2018
Messages
8
Hi Paul,

Thank you for your response! I haven't tried the wizard yet, but I will if I can't figure it out another way.

One of my main goals is to really understand the full manual process so that I will be able to build upon it and develop better and more complex features in the future. I'm just a bit flummoxed by Access and I haven't quite grasped these basics yet.

Honestly, I stumbled upon a detailed explanation for this process at one point, but I've been through my browsing history n times and I tried to replicate my exact search terms, but I just haven't been able to find it again. So if anyone just has some good links to existing explanations, I would be immensely grateful!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:49
Joined
Aug 30, 2003
Messages
36,115
You could use the wizard and see what it produced. In general, form is bound to risks table. Add a combo, make the project table its row source. Set the bound column to 1, the column count to 2, the column widths 0;2 (or the appropriate width). Its control source is the project field in the risks table.
 

platypusfeet

New member
Local time
Today, 03:49
Joined
Nov 14, 2018
Messages
8
Hi Paul,

Thank you! You're absolutely right - by using the wizard I am able to dig into the properties of the combobox and learn the different pieces involved. Your explanation also helps to clarify things for me.

Thanks again!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:49
Joined
Aug 30, 2003
Messages
36,115
Happy to help and welcome to the site by the way!
 

Users who are viewing this thread

Top Bottom