Cannot add new data to a form

G

Guest

Try this one on for size. I have three forms (Contacts, Calls(Call details), Gifts) all three are joined properly by the ContactID field. I start by opening the Contacts form and enter the contact info. I then open the calls form (which is an action button) to enter detailed call data. I close the calls form and I am returned to the Contacts form. I then Open the Gifts form(which is also an action button) to enter gift data. When I go to close the gifts form I get this error. "You cannot add or change a record because a related record is required in the table'Contacts'". No I thought that I had already created the contact when I enter the data into the Contacts form. The funny thing is that when I close all the forms and reopen the contacts form and click the gifts form button I can add gift data and it will then save the gift data and allow me to close out. What action am I missing here? Pleas help this is an emergency! Thanks
 
P

PC Datasheet

Your tables are not set up correctly!

You Need:

TblContact
ContactID
FName
LName
etc

TblGift
GiftID
ContactID
GiftDesc

TblCall
CallID
ContactID
CallDate

TblCallDetails
CallDetailsID
CallID
CallDetail

Then you need a form/subform for:
Contact/Gift
Contact/Call
Call/CallDetails


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
BradleyJ said:
Try this one on for size. I have three forms (Contacts, Calls(Call details),
Gifts) all three are joined properly by the ContactID field. I start by opening
the Contacts form and enter the contact info. I then open the calls form (which
is an action button) to enter detailed call data. I close the calls form and I
am returned to the Contacts form. I then Open the Gifts form(which is also an
action button) to enter gift data. When I go to close the gifts form I get this
error. "You cannot add or change a record because a related record is required
in the table'Contacts'". No I thought that I had already created the contact
when I enter the data into the Contacts form. The funny thing is that when I
close all the forms and reopen the contacts form and click the gifts form button
I can add gift data and it will then save the gift data and allow me to close
out. What action am I missing here? Pleas help this is an emergency! Thanks
 
M

Marshall Barton

BradleyJ said:
Try this one on for size. I have three forms (Contacts, Calls(Call details), Gifts) all three are joined properly by the ContactID field. I start by opening the Contacts form and enter the contact info. I then open the calls form (which is an action button) to enter detailed call data. I close the calls form and I am returned to the Contacts form. I then Open the Gifts form(which is also an action button) to enter gift data. When I go to close the gifts form I get this error. "You cannot add or change a record because a related record is required in the table'Contacts'". No I thought that I had already created the contact when I enter the data into the Contacts form. The funny thing is that when I close all the forms and reopen the contacts form and click the gifts form button I can add gift data and it will then save the gift data and allow me to close out. What action am I missing here? Pleas help this is an emergency! Thanks


Here's another idea. Maybe you forgot to save the contact
record before opening the other form??
 

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