comments inline.
Lynn said:
Thank you Tina, I think this is finally making sense to
me and I am getting confirmation that I am on the right
track. Can you please explain to me exactly how the
linking tables work with the combined primary codes.
Should they have a special name.
if you mean the fields in the linking table, i would give them unique names.
personally, i never use the same fieldname twice in one database. also, i
like to know exactly what table a field belongs to, so i start all my
fieldnames with the (usually) first letter of the tablename. for instance
tblJobs, would have JID (primary key), JName, etc, etc. also, i keep the
"original name" of all my foreign keys but add a prefix so i know they're
foreign key fields.
so, if i were naming your linking table, i'd call it
tblJobQuotes
JQfkJID (primary key from tblJobs)
JQfkQID (primary key from tblQuotes)
but that's just me. the main thing is to come up with a standard way of
naming all your objects - tables, fields, queries, forms, reports, macros
and modules - and stick with it, be consistent. that way you know what
you're looking at, and so does the next developer who comes along and has to
work on your database. the only "rules" you really need to take to heart
are:
1) don't use Access Reserved words such as Name, Date, etc.
2) don't put spaces or special characters in names; use numbers, letters and
underscores ( _ ) only.
I think I have them
linked together correctly as one primary key:
it's easy to tell. in table design view, the square "record selector" box at
the left of the fieldname has a little key in it to designate the primary
key field. in your linking table, both fields should show the little key.
Access only allows one primary key, by default. so when more than one field
has a key designation, you have one combination primary key - not 2 separate
primary keys.
The information that shows under the Indexes is:
Line1(Index Name) Customer ID (Field Name) Customer ID
Line2(Index Name) Primary Key (Field Name) Quote ID
Line3 (Index Name) Blank Space (Field Name) Customer ID
Line4 (Index Name) Customer ID (Field Name) Quote ID
if those're the indexes the system assigned, then they're probably fine. i
rarely, if ever, change an index assigned by the system.
Just one more thing for clarification at this time. How
does the linking table affect forms that I will be making
up with Quotes and Jobs. What do I use as the Primary
Key from the linking table? Should this Combined Prinary
Key have a special name? I am not sure about what will
happen to this link for the next step.
based on the requirements you specified, you'll need to be able to enter
quotes as independent records, and jobs as independent records - so let's
say separate forms for each of them. based on the idea that a quote comes
before a job, suggest you set up the linking table as a subform of frmJobs.
the form/subform will be linked on the JobID (or JID) field in both tables.
you'll only enter a record in the subform when you want to link a specific
quote record to a specific job record. the JobID will be entered
automatically in the subform record, all you have to do is enter the QuoteID
(QID) - typically you'd use a combo box to show a list of all quotes for the
CustomerID assigned to that job record.
I apologize for being ignorant about the workings of
Access but I think the best way to learn is having
something to apply it too.
i agree; i've never been any good at "theoretical" problems. i think you're
doing well, and i was impressed that you started out by researching tables
and relationships. that was the very best thing you could have done, and so
many people don't do it.
i hope i didn't confuse the heck out of you with any of the above comments;
i'm not nearly as clear and concise as i'd like to be - being much better at
"show" than "tell". if you'd like an example of the setup i described, post
your email address (but beware the spammers), and i'll send one to you.
Thank you so much for your assistance.
you're welcome.
hth