How to use where statement??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table with two primary keys. I have a query that displays all
primary keys for that table. I want to be able to double click on a primary
key in that query and then display the entire record in a new form using a
macro. I do this without any problems to tables with single primary keys and
it works OK. It seems to be a problem with the two primary keys.

Do i have to create another field in this table that creates a unique number
and make this the primary key???

Any help would be very much appreciated.
 
Hi fesz,
Yup - you answered your own question really.
Firtsly, you should only have ONE Primary Key. That's why it is called a
"PRIMARY" Key. You can Index as many fields as you want to enable fast
sorting in a query, (although if you Index too many it loses its relevance)
but to be able to exactly establish which row you are trying to retrieve you
should set an Autonumber ID Field as the Primary Key.
 
Geoffs said:
Hi fesz,
Yup - you answered your own question really.
Firtsly, you should only have ONE Primary Key.

You CAN only have one primary key. If you try to set another field as PK,
the first field will automatically be unselected. Perhaps he has a
multi-field primary key and thinks he has more than one PK since a key shows
up on each field that makes up the compound PK. This is OK. Sometimes the
data isn't unique on a single field.

Tom Lake
 
You casnnot do this in a query. You can do it in a form
using the doubleClick event.

Chris
 
Back
Top