form / subform - problem adding new record! - can't save main record

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

running access 2k;

I have the following 2 tables:
employee: ssn (key; no dups)
complaints: ssn (key; dups ok), id (key; no dups)

I have employee joined to complaints by [ssn] in a 1 to many relation.

I have 2 forms:
main: linked to employee table
sub: linked to complaints table

The main form contains sub (as a sub-form linked to main by [ssn] )

PROBLEM:
when adding a new record to main, I cannot add any data to the
sub-form because the main recordset hasn't been saved yet.

I've tried doing a "DoCmd.RunCommand acCmdSaveRecord" in various
locations such as:
sub-form - on-enter (from main form)
sub-form - on got focus (in sub-form)

there must be a solution to this, but I can't see it!!

any help appreciated!

tia - Bob
 
You have to create a query linking the two tables and use
it as the record source for the main form. Using the
employee table alone will not work, even though the
relationship has been set up.
 
Jack,

tx so much; I'm sure that will clear things up!

Bob


You have to create a query linking the two tables and use
it as the record source for the main form. Using the
employee table alone will not work, even though the
relationship has been set up.
-----Original Message-----
running access 2k;

I have the following 2 tables:
employee: ssn (key; no dups)
complaints: ssn (key; dups ok), id (key; no dups)

I have employee joined to complaints by [ssn] in a 1 to many relation.

I have 2 forms:
main: linked to employee table
sub: linked to complaints table

The main form contains sub (as a sub-form linked to main by [ssn] )

PROBLEM:
when adding a new record to main, I cannot add any data to the
sub-form because the main recordset hasn't been saved yet.

I've tried doing a "DoCmd.RunCommand acCmdSaveRecord" in various
locations such as:
sub-form - on-enter (from main form)
sub-form - on got focus (in sub-form)

there must be a solution to this, but I can't see it!!

any help appreciated!

tia - Bob
.
 
Back
Top