473,394 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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?
Nov 12 '05 #1
1 1709
Richard Hollenbeck previously wrote:
I'm getting errors. Access is telling me that it can't add a record.
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?
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?


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


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
9
by: Greg | last post by:
Binding Manager & dataset - won't add record I've got an untyped dataset with controls bound through code. The user can select a question number from a bound combobox, and the question number and...
1
by: Nkagi | last post by:
Hi All, I have a problem of adding records into table, if the cursor is on the first record the record that I add replaces the first record and then I moved it to the last record and the new...
0
by: HS1 | last post by:
Hello all I have a DataGrid1 presenting records of a table ("clients") in a Access Database through a DataSet (ds) using DataAdapter (da1) and buttons "add", "save" and"delete" buttons with the...
2
by: Rico | last post by:
Hello, I'm formatting a report based on an existing controlled document. The document that I'm duplicating has a number of lines that the user fills our manually, but the database version of...
7
by: Miro | last post by:
Im a VB Newbie so I hope I'm going about this in the right direction. I have a simple DB that has 1 Table called DBVersion and in that table the column is CurVersion ( String ) Im trying to...
1
by: DH | last post by:
I have an untyped dataset with a table. I am trying to programmatically add a row to this table. This was working in VS 2003 / .net 1.1 I am receiving an error "Object reference not set to an...
3
by: benkollam | last post by:
Hi, I have problem updating the changes in the dataset to the database. I am using an Access database and following is the code used for adding a new row. Please help Private Sub...
6
by: Michael Kintner | last post by:
I am looking for add-on tools or code to allow me to attach scanned PDF documents to a database record. I would like to know if there are developer tools out there that can do the following: -...
4
by: jaz215 | last post by:
hi! how do i add a record in a database without using the datacontrol and adodc. i want to rework my code to using purely codes and not being dependent on the design on vb. so far i have. Set rs...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.