Hi Jeff:
Thanks for your reply. Since you're the gent who replied to my
previous post (quoted below), you might recall what I'm trying to do.
This database tracks my writings, which fall into five genres: Plays,
Musicals, Monologues, Lyrics, and Other. Each genre has its own set
of details. For example, Plays and Musicals have "Number of acts",
Monologues, Lyrics and Other do not.
For data entry and retrieval, I have one form for all works, others
for details pertaining to each of the five genres.
One of the detail fields for Lyrics is "Show Source" ("Which Musical
does it come from?"). Having this also allows me to make a query
listing all the songs in a particular Musical. To populate this field
for any Lyric record, I need a combo box built on a query listing all
of my Musicals.
Access wouldn't allow me to make that combo box while all my fields
were in one table. That's why I split it into two tables, retaining
the "WorkID" field in each of them so I could relate them. All
fields common to all genres are in one table, all details regardless
of genre are in the other. I'm sure my table structure is not ideal,
but that's what I came up with.
The existing forms are now built on queries
recombining the two tables. Everything seems to be working except
that when I add a new record, its row in the second table doesn't pick
up the ID field from its associated field in the first table.
I know I'm probably trying to do more than I have the ability to do,
but I seem so close. Any ideas?
Thanks again,
Pic
If you add a new lookup value to your lookup table, why would Access need to
add it to your "main" table? Perhaps you are using the term "lookup" in a
way that varies from how Access describes this?
If you are using forms for your data entry (and please do, tables are great
for storing data, but forms are designed to display/add/edit), create a
combo box with your lookup table as a row source. Bind this control to your
main table's WorkID field. This gives you a mechanism for adding a new
(main) record and selecting the appropriate WorkID (from the lookup table).
You can also use the NotInList event of that combo box to add a new lookup
value.
Not really sure I understand your design, but the error message you
reported
makes it sound like you are trying to put more than one fact in a
field.
And it also implies that you are trying to do a lookup of a lookup.
Just a hunch, but do a search on "cascading combo boxes" and see if
this
isn't what you are trying to do.
Also, before you push further on this, step back and diagram the
relationships -- your explanation seems to indicate that the Genre
"Lyrics"
has related "Musicals", and the Genre "Musicals" has related "Lyrics".
Is
this a many-to-many relationship?
Your post also implies that you are using the "lookup" data type in
your
table definition -- if so, review this newsgroup's (tablesdbdesign)
postings
on the topic -- there are a LOT of reasons not to use this "feature"
in your
table definitions.