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

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
 
J

Jack

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.
 
B

Bob

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
.
 

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