form not able to edit or add record in subform

  • Thread starter cableguy47905 via AccessMonster.com
  • Start date
C

cableguy47905 via AccessMonster.com

I have two tables. They have a one to many relationship. When I use a form
to enter data into the main table, I need to also create at least on record
even if blank in the other table, otherwise I will not be able to edit or add
a new record to the smaller table.

The two tables are like this:

Contact Table (Main)
Map table - Can have many maps to one contact

They are updated by a main form with a subform. The subform is built on the
Map Table and the main form is built on a query of the Contact Table and the
Map table. (There are three fields that need to be shown on the main form
that are in the Map table.) This query has a left outer join so that I do
not show all of the possible records, just those new records on the main
contact table. When I build a new contact, I need to be able to build a new
map (even if it is blank, I guess).

I can currently update all records that are in both tables, but any new
record must exist in both tables If I am to be able to edit later.

Any help would be much appreciated.
Thanks,
Lee
 
J

John W. Vinson

I have two tables. They have a one to many relationship. When I use a form
to enter data into the main table, I need to also create at least on record
even if blank in the other table, otherwise I will not be able to edit or add
a new record to the smaller table.

That is an INCORRECT STATEMENT.

It is not necessary, and almost never appropriate, to create an empty
"placeholder" record in the child table.
The two tables are like this:

Contact Table (Main)
Map table - Can have many maps to one contact

They are updated by a main form with a subform. The subform is built on the
Map Table and the main form is built on a query of the Contact Table and the
Map table. (There are three fields that need to be shown on the main form
that are in the Map table.) This query has a left outer join so that I do
not show all of the possible records, just those new records on the main
contact table. When I build a new contact, I need to be able to build a new
map (even if it is blank, I guess).

I can currently update all records that are in both tables, but any new
record must exist in both tables If I am to be able to edit later.

Sounds like you have the mainform-subform relationship "upside down", which is
causing your difficulty. Normally a Form is used for the "one" side, and a
Subform for the "many". Could you explain why?

John W. Vinson [MVP]
 
C

cableguy47905 via AccessMonster.com

Yeah, you are absolutely correct. I wasn't going far enough when I was
testing my forms. I would only go so far as create a new record on the main
form and then check the record navigation buttons on the subform to see if it
was "lit up" to allow for an additional record. They weren't lit up until I
entered the first field, which makes sense because the primary key is a
autonumber which wouldn't have been generated yet.

My fault. I do appreciate you quick response, though.

FYI, I'm not creating a blank record at all. I just couldn't figure out why
I couldn't add one. I had the relationships all right, just didn't go far
enough.

Thanks again,
Lee
I have two tables. They have a one to many relationship. When I use a form
to enter data into the main table, I need to also create at least on record
even if blank in the other table, otherwise I will not be able to edit or add
a new record to the smaller table.

That is an INCORRECT STATEMENT.

It is not necessary, and almost never appropriate, to create an empty
"placeholder" record in the child table.
The two tables are like this:
[quoted text clipped - 11 lines]
I can currently update all records that are in both tables, but any new
record must exist in both tables If I am to be able to edit later.

Sounds like you have the mainform-subform relationship "upside down", which is
causing your difficulty. Normally a Form is used for the "one" side, and a
Subform for the "many". Could you explain why?

John W. Vinson [MVP]
 

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