adding record to linked table

  • Thread starter Thread starter Melissa
  • Start date Start date
M

Melissa

I have a form with a subform in it. Say customer #155 has
a record in the table underlying the main form. How do I
get Access to add a record with the same key (cust#) to
the table underlying the subform?

Thanks
 
Set the subform control's Link Master Fields and Link
Child Fields to main table's primary key field name and
the name of the foreign key in the subform's underlying
table, respectively.
 
It is set up that way. It still won't fill in the key
field of a new record in the subform's table when other
subform fields are populated. What else could it be?
 
Please post the structures of the underlying tables or
queries of the main and subform, and the Record Source
properties of each.
 
OK, the original form is working, but I'm having a similar
problem with another. The difference is that I want to
populate something other than the key field in the child
table. Is this even possible?

Child: book group custs
group# - number
cust#
 
continuation...
(oops, no rich text, tab a is no-no)

book group custs table (child)
fields group# - number
cust# - number **KEY

book group master table (master)
fields master cust# - number
group name


When master cust# is populated, I want the same value to
populate both group# and cust# in the child table.
 
Melissa,

I'm afraid I don't understand the purpose of your
database, or why you want to store the same information in
two different fields. Could you tell me generically what
you're trying to store?
 
bg master is the 'one' side of a one-to-many.
For each book group, I want to have at least one
customer. The group number could be anything, but I chose
to use the customer number.

Ex:
bg master record
group# name
20 taco bell

bg cust record
group# cust#
20 20
20 21...

I want to make sure no records get into bg cust with a
group# and no cust #.

If you like, e-mail me directly at (e-mail address removed)

Thanks for your help.
 
Melissa,

I think you'd be better off having a primary key for your
master table that has nothing to do with a key of another
table, and to try to organize your tables around "things",
like "Groups", "Members", "Orders", etc.

In any case, I suggest you simply change the Default Value
property of Cust# to =[Group#]. Does that solve it?

KGS
 
Back
Top