What am I doing wrong

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

Guest

I have two tables linked in a relationship by Key Ring numbers. It is a one
to many relationship. I have the Keys main from , that when I enter the Key
ring number, Location and number of keys in the main from, then go to the sub
form I am only allowed to enter one key number and location at a time. I
would like to enter as many as 28 keys and locations per Key ring number.
When I view the form I have to scroll through the sub form to view all the
keys on the key ring. I need to see all the keys on the ring at once. Thanks
in advance.
 
tlbKeyRing
Key Ring
Location of Ring
Number of Keys
tlbKeys
Key Ring
Key number
Location of Key

Main form tblKeyRing
Sub form tlb just Key number and Location of Key

Relationship One to many
tlbKeyRing/Key Ring -- to --tblKeys/Key Ring

Thank you in advance.
 
Mike,
What you have done is create a one-to-one relationship, rather than a
one-to-many. Try this instead.

tblKeyRing
KeyRing (Primary Key)
LocationOfRing
NumberOfKeys

tblKeys
KeyID (Primary Key)
KeyRing (ForeignKey)
KeyNumber
LocationOfKey

Let me also suggest that you remove the spaces from your field names. They
will only lead you to headaches later on.


--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html
 
Lynn thanks for your post. First this did work, I have a question. When I
create a field called Key ID and make it a primary key, I don't want that
user to have to add data to this field (Don't know what data to have them add
to it). I made it a (auto number) type field, because I can not leave null.
Then I can't run a query, because the filed type does not match the other
tables primary key. Any help with this. thanks ina dvance.
 
Back
Top