PC Review


Reply
Thread Tools Rate Thread

'Can not add or change record' error message

 
 
=?Utf-8?B?V0NEb2Fu?=
Guest
Posts: n/a
 
      3rd Mar 2006
I apologize if this has been answered before. I looked but could not find a
post for this particular problem. I'm using a form that has a command button
that calls another form. The table on the form that is called is related to
the table in the main form by CustomerID field...PK in main form, FK in
called form. A record in the main table is selected and then you press the
command button to call the form to enter the related data in the other table.
Thanks to Roger for getting me this far with passing arguments. I have the
correct fields for the data in the called form, but when I try to add a
record to this table, I get the 'can not add or change a record because a
related record is required in table users.' The table Users is the table
bound to the main form. I thought since that record was already selected, I
could add a record in the related table, but evidently I'm not doing
something right...which is not unusual for me with Access and VBA, although I
am getting better. Anyhow, if anyone could shed light on this I would
appreciate it.
Thanks,
Randy M
 
Reply With Quote
 
 
 
 
SteveS
Guest
Posts: n/a
 
      7th Mar 2006
It sounds like you are not putting the PK from selected record in the Users
form (main form?) into the FK field in the "related table form".

What arguments are you passing from the "main form"? Are you passing the PK?
Actually, what is the code form the command button now? (I went and read a few
of your previous posts.)


--
Steve S.
--------------------------------
"Veni, Vidi, Velcro"
(I came, I saw, I stuck around.)

WCDoan wrote:
> I apologize if this has been answered before. I looked but could not find a
> post for this particular problem. I'm using a form that has a command button
> that calls another form. The table on the form that is called is related to
> the table in the main form by CustomerID field...PK in main form, FK in
> called form. A record in the main table is selected and then you press the
> command button to call the form to enter the related data in the other table.
> Thanks to Roger for getting me this far with passing arguments. I have the
> correct fields for the data in the called form, but when I try to add a
> record to this table, I get the 'can not add or change a record because a
> related record is required in table users.' The table Users is the table
> bound to the main form. I thought since that record was already selected, I
> could add a record in the related table, but evidently I'm not doing
> something right...which is not unusual for me with Access and VBA, although I
> am getting better. Anyhow, if anyone could shed light on this I would
> appreciate it.
> Thanks,
> Randy M

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: Error message "You cannot add or change a record" =?Utf-8?B?c2N1YmFkaXZlcg==?= Microsoft Access 1 16th Mar 2007 02:03 PM
error message when attempting to change a record =?Utf-8?B?Uk1T?= Microsoft Access Forms 0 18th Oct 2004 03:43 PM
Change Default Message Box (Duplicate Record) Andy Microsoft Access Forms 3 19th Jul 2004 04:10 PM
error message when trying to add new record martha.mccoy@ngc.com Microsoft Access Forms 0 20th Oct 2003 01:46 PM
Re: Change default message of delete record command Scott McDaniel Microsoft Access Forms 0 18th Aug 2003 11:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:12 AM.