Append query not working

R

Rodney

I have this Append query set up to append to a table from fields on a form
and subform, the query seems to run ok (no errors) but doesnt append the
records to the table. here is the sql.

INSERT INTO tblExamResults ( CourseExamID, ExamName, DivisionID,
StudentCourseID, StudentPMKeysNumber )
SELECT
[Forms]![frmAddExamToDivision]![frmAddExamToDivisionSubform]![CourseExamID]
AS CourseExamID,
[Forms]![frmAddExamToDivision]![frmAddExamToDivisionSubform]![ExamName] AS
ExamName, tblStudentCourses.DivisionID, tblStudentCourses.StudentCourseID,
tblStudentCourses.StudentPMKeysNumber
FROM tblStudentCourses
WHERE
(((tblStudentCourses.DivisionID)=[Forms]![frmAddExamToDivision]![DivisionID]));

Any help would be great thanks
Rodney
 
A

Allen Browne

What happens if you preview the query (in datashseet view)?
Do you seen any records?

No: the query shows no records.
========================
Ensure the query understands the data types. For example, if DivisionID is a
Number (or AutoNumber) type field, choose Parameters on the Quey menu (in
query design). In the dialog, enter:
[Forms]![frmAddExamToDivision]![DivisionID] Long
Also, if the text box on the form is unbound, set its Format property to
General Number so Access knows how to understand it.

More info on typecasting in this article:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html

Yes: the query shows the right records.
=============================
How are you executing this query? Have you turned off SetWarnings so you
don't get any message if the insert fails?

It may be that the query results violate a rule of the table, or a unique
index, or are the wrong data type, or several other reasons why the insert
might be rejected.
 
R

Rodney

Thank you Allen.
I have checked through all and is working fine now, more operator error than
anything else.
Thanks Again
Rodney
 
Top