Append query not working

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

Guest

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
 
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.
 
Thank you Allen.
I have checked through all and is working fine now, more operator error than
anything else.
Thanks Again
Rodney
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top