Relationships versus Queries

reboot_computers

Registered User.
Local time
Today, 22:40
Joined
Jan 14, 2012
Messages
10
Hi

I am I but confused as whether I need to use relationships or queries for drop down boxes in a form or table in access 2007 as I did have a couple of drop down boxes working but having say a customer table and say a title table and using a primary key on the customer table and a foreign key on the title table but I have tried using a query but do I still need a relationship set up. Any help would be great if someone could please explain .


Thanks
 
a relationship is a relationship, pk and fk irrespective of comboboxes queries reports forms or code... a relationship is a relationship
 
More specifically, yes you need a relationship within the query (otherwise you get what's called a Cartesian Join, which is bad news). If you define the relationship permanently within the Relationships window of Access, it SHOULD set up automatically for you when you drag those tables into a query. But you can/will need to do it by hand occasionally.
 
Thanks David

I'm the sort of person that will keep trying to do something without using the wizards because I want to know I can fix it when it goes wrong so I probably waste a lot of time as I won't feel comfortable until I know exactly how it works.

Is it possible to have a drop down list that isn't using a query just with a relationship between 2 tables. I am trying to do a customer list but say have a title drop down as in mr, miss , mrs, etc but all I seem to get is the id as both the primary key and foreign key are both set to a number.

Thanks for your help.

Paul E
 
There are a few properties of a combo that you need to understand.
The RowSource which is either a query, table, or value list, is what controls the values you see when you drop the list.
The ColumnCount specifies how many columns are in the RowSource. If the ColumnCount doesn't match the column count of the RowSource, the combo won't work correctly.
The ColumnWidths specifies how wide each column will be when the list is displayed. Setting the width of a column to 0 will hide it. In your case, you want the width of the ID column to be 0 to hide it.
The BoundColumn tells Access which column in the Form's RecordSource will hold the selection from the combo.
 
Thanks for that Pat. The only other thing it is really bugging me is when I add a drop box and it says unbound, which I think is because the form isn't bound to a table but to be honest I'm not sure if I'm looking at the wright property box.


Thanks again to everyone for their time.


Paul Edwards
 
Your dropdown is a combo box in Access terminology.

Here's a link to some sample combo box info. Hope it's useful.
 

Users who are viewing this thread

Back
Top Bottom