Connecting Tech Pros Worldwide Help | Site Map

adding a record into a sub-form

  #1  
Old November 12th, 2005, 09:25 PM
Richard Hollenbeck
Guest
 
Posts: n/a
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, 09:25 PM
Peter Russell
Guest
 
Posts: n/a

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








Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Table defaults not used when adding record in code rdemyan via AccessMonster.com answers 5 October 16th, 2006 01:45 PM
Help with Adding A Row Miro answers 7 September 20th, 2006 02:15 PM
adding records to a table Nkagi answers 1 November 21st, 2005 07:44 AM
adding record to sql db Bryan answers 20 November 20th, 2005 01:28 PM
DataGrid - Adding Rows Jim Heavey answers 3 November 18th, 2005 12:06 AM