Connecting Tech Pros Worldwide Help | Site Map

adding a record into a sub-form

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 08:25 PM
Richard Hollenbeck
Guest
 
Posts: n/a
Default adding a record into a sub-form

I'm getting errors. Access is telling me that it can't add a record. I
have a table of college courses and a linked table of groups of activities
in that course as a linked table (one course to many groups of activities).
"Groups" include things like Participation, Exams, Essays, Etc., Etc., Etc.
I have a main form showing the course information (courseID,
courseDescription, courseStartDate courseEndDate, etc.) and a sub-form
showing the individual groups within that particular course. The sub-form
doesn't show the courseID because it's obvious; it's the current course in
the main form.

How do I send the courseID of the current course into the group table's
corresponding field? VBA? I don't know how to do that. I have the
relationship property set to "enforce referential integrity" and both
"cascade update" and "cascade delete" Shouldn't that be enough? Maybe I'm
doing something else wrong?



  #2  
Old November 12th, 2005, 08:25 PM
Peter Russell
Guest
 
Posts: n/a
Default Re: adding a record into a sub-form

Richard Hollenbeck previously wrote:
[color=blue]
> I'm getting errors. Access is telling me that it can't add a record.[/color]

To what - the main form or the subform? (I'm assuming it's the subform)
What is the message and when do you get it?
[color=blue]
> I
> have a table of college courses and a linked table of groups of
> activities
> in that course as a linked table (one course to many groups of
> activities).
> "Groups" include things like Participation, Exams, Essays, Etc., Etc.,
> Etc.
> I have a main form showing the course information (courseID,
> courseDescription, courseStartDate courseEndDate, etc.) and a sub-form
> showing the individual groups within that particular course. The
> sub-form
> doesn't show the courseID because it's obvious; it's the current course
> in the main form.
>
> How do I send the courseID of the current course into the group table's
> corresponding field?[/color]

If the subform is based on a table or a simple query of that table then as
long as the mainform-subform link is correct this should be ok. The
courseid value should be entered automatically.

If this is not working then look at the form subform links to be sure you
are using the courseid as the master and child link field.
Another possibility is that the query for the subform is too complex and
is not updateable. If you run the query on its own can you add/edit
records?

Other less likely possibilities are that the subform is set to
AllowAdditions = No (you would not be able to go to a new record) or that
the subform control is locked (you could get to new record but not enter
anything)

Peter Russell








 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.