Entering records on a subform

D

David Robinson

I have read topics related to my problem but I can't seem to find a solution.
I have a form that has a combo box containing events. The records for the
combo box come from a query. After selecting an event, a subform is
populated with staffing information related to the event. The subform is
based on a different query. As long as this staffing information already
exists, it is displayed with no problem. But if there is no exiting data,
the controls in the subform do not appear. On the subform, data entry is set
to "no," allow additions is set to "yes," recordset type is set to "Dynaset
(inconsistent updates)," and record locks is set to "No locks."

My goal is to be able to enter the subform information if it does not
already exist. Any suggestions?

Thanks
 
J

Jeanette Cunningham

Hi David,
I think the way the main form and subform are setup is preventing adding new
records.
Would you post the table names that both main form and subform are based on
and for each of those 2 tables, the primary key and any foreign keys.
How are the 2 tables related?

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
D

David Robinson

Main form:
Table=Events
Primary key=EventID (autonumber)

Subform: (this may be part of the problem now that I look at it)
Tables=none
It ls based on a query that, in turn, is based on a table called ICS
information. However the Events table is part of the query as well.
the ICS information table has a primary key called "ID number" (autonumber)
and a foreign key called "Event ID". This field is related to the "EventID"
field in the Events table.
 
J

Jeanette Cunningham

I suggest that the main form is based on a query using the events table.
The subform is based on a query using the ICS table.
Remove any events table fields from the subform's query (however, include
the foreign key EventID from table ics).

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
D

David Robinson

It took the events table out of the subform query and it solved the problem.
Thanks for seeing what I couldn't!
 

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