Problems entering info into a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a command button linked to a form that holds the name, date, title
and trainer of all our training classes (frmCourse). I have another command
button linked to to another form (frmBannerRespondent2) where I enter
information applicable to the class itself (date, course number, respondent
number, trainer, Yes/No boxes, comments, etc.).

When I click on the command button linked to the Banner form, I can enter
the information, but if I go to change something I get the message:

You cannot add or change a record because a related record is required in
table 'tblcourse'.

I go to the frmCourse form and try to remove/change what I have in there,
but that form gives me the message:

The related record cannot be deleted or changed because table
'tblBannerRespondent2' includes related records.

The Data Entry is set to No and the Filter/Sort is off, but what else can I
do to get rid of these messages? I'm sure it's something I've done before
but I can't figure out what....

Thanks for all your help!
 
Hi.
Check your table relationships. Investigate Referential Integrity and the
cascading features. It sounds like there may be one too many checkboxes
selected in the join properties between two of your tables.
 
I understand what you mean by table relationships and checkboxes (although I
still have no idea how I got my tables to have a one-to-many relationship),
but I'm not sure if I know where I would look at the join properties; would I
go into the queries linked to my form and look at them in Design view?

I also don't understand what you mean by 'Investigate Referential Integrity
and the
cascading features'.

(I'm teaching myself how to build dbs that use command buttons that take you
from one form to a subform and have been copying, renaming and changing parts
of the tables, queries, forms and reports that already exist so I'm a real
newbie at Access.)

Thanks!
 
Hi, Anita.
I found this response from another user answering a similar question
regarding the error message you are receiving:

"If you have a form/subform (a relationship of One-to-Many) then there must
be a record in the 'One' table, your main form, before you can add a record
to the 'Many' table, which is your subform. If this is the setup you have be
sure that you have your Master/Child links set up correctly and that the data
in the main form has been saved before you try to enter data into the subform.
It sounds like maybe the data in the main form has not yet been saved. In the
On Exit event of the main forms last control (the control before you move to
the subform) force a save with:

DoCmd.RunCommand acCmdSaveRecord

This is my best guess on why you are getting the error you are getting...."
 
My deepese apologies for not answering this sooner, but we're adding a new
system where I work and I was pulled away to work on that....

I went in and played a little more and fixed it. I couldn't tell you what I
did that fixed it, though. It may have been the Master/child relationship
going from an 'Indeterminate' relationship to a 'One-to-many' relationship.

Thanks a bunch for all your assistance, and I apologize again for not
responding sooner.
 
Back
Top