Creating SubForms

G

Guest

I am trying to create a form from two tables with one of the tables being a
subform on the main form. One table contains all of my information and the
other table is a notes table that contains, Notes ID (PK), Date, and Notes
(memo). I was told that it is best to have your notes information separate
and then to setup a relationship to the main table. That way it saves on
space. I'm having a problem getting the subform in the main form to work
correctly. What is the best way to create this? When I create it one way,
whatever information I add into the subform shows up on all of the records,
even though I only want it on the one record that it pertains to. Then when
I create it another way, I can enter the information but then it doesn't stay
there.

I would appreciate any suggestions!!! Thanks!
 
J

Jayyde

I don't see a foreign key in that Notes table relating it to your other
table's PK...
 
G

Guest

My main table (tblPagerUsers) has the following: ID (PK), LastName,
FirstName, PagerNumber, NotesID (FK). The other table I have PagerID (PK),
Date, Notes. I set the relationship between the two tables with the PagerID
from tblPagerNotes to NotesID in tblPagerUsers. The thought is that I could
have many notes to one user. Does that help??
 
J

Jayyde

You want it the other way around. You want to have the User ID in the Notes
table. The way you have it now you can have lots of users for one note
instead of lots of notes for one user.

hth
-Jayyde
 
G

Guest

I'm not sure I understand. What I did now was take the PK (ID) from tblPager
Users and set the relationship to go to the FK (Notes) in the tblPagerNotes.
Is that what you meant? If so, when I create the subform, it still isn't
working.

Thanks again for your help!
 
J

Jayyde

The 2 tables should be something like this:

tblPagerUser:
UserID (PK)
LastName
FirstName
PagerNumber

tblPagerNotes:
NoteID (PK)
UserID (FK)
Date
NoteText

No FK in the user table.

hth
-Jayyde
 
G

Guest

THANK YOU THANK YOU THANK YOU!!!! It is working now!!!! You don't know how
much I've struggled with this!!!! Thank you!!!!!
 
J

Jayyde

You're welcom =)

-Jayyde

Lori said:
THANK YOU THANK YOU THANK YOU!!!! It is working now!!!! You don't know
how
much I've struggled with this!!!! Thank you!!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top