Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble adding entries to a subform when new record

Status
Not open for further replies.

Handford

Technical User
Oct 4, 2005
19
GB
I have made a database which assigns people to an event. There is a form called "Event" which has an entry for each event in the database (with autonumber primary key). Whithin this form there is a subform listing the people associated with this event. This subform is simply taken from the link table between people and events. A button is used which opens another form (called "Add_Attendee") which allows the user to add people to events (i.e. allows user to select people from a list and put it in link table with correct event PK.

All of this usually works fine. However when a new event is added to database it no longer works. It seems to not recognise the new event until the user had moved to a new record and back again. When the user does this it works again. The error message on these new eventss is:

"You cannot add or change a record because a related record is reqired in table 'Event'"

Any ideas how to make it stop doing this- I thought about making it run a requery macro when the add an attendee button is first pushed. This did not work.

Thanks

Chris

 
Why don't you take a look at the Event Management example in Microsoft Access. It could be the way you have your relationship, queries or record source setup behind your main form & subform.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top