T
Tanya
Hi
I have a problem with an append query, the commandbutton is on a form in add
mode and I need to pick up parameter values from the form. I have also pasted
a copy of the append query:
Private Sub CmdNew_Click()
'Run Append Query
DoCmd.OpenQuery "qryAppendUnitstoStudentClass"
DoCmd.Close acDefault, "qryAppendUnitstoStudentClass"
'Begin New Record
DoCmd.GoToRecord , , acNewRec
End Sub
Append Query:
INSERT INTO tblCompetency ( StudentClassID, SubjectID, UnitID, ElementID,
PerformanceID )
SELECT tblStudentsClasses.StudentClassID, tblSubjects.SubjectID,
tblUnit.UnitID, tblElements.ElementID, tblPerformanceCriteria.PerformanceID
FROM ((tblSubjects INNER JOIN tblUnit ON (tblSubjects.SubjectID =
tblUnit.SubjectID) AND (tblSubjects.SubjectID = tblUnit.SubjectID)) INNER
JOIN (tblClasses INNER JOIN (tblStudents INNER JOIN tblStudentsClasses ON
tblStudents.StudentID = tblStudentsClasses.StudentID) ON tblClasses.ClassID =
tblStudentsClasses.ClassID) ON tblSubjects.SubjectID = tblClasses.SubjectID)
INNER JOIN (tblElements INNER JOIN tblPerformanceCriteria ON
tblElements.ElementID = tblPerformanceCriteria.ElementID) ON tblUnit.UnitID =
tblElements.UnitID
WHERE
(((tblStudentsClasses.StudentClassID)=[forms]![frmAddStudentstoClass]![StudentClassID]) AND ((tblSubjects.SubjectID)=[Forms]![frmClasses]![SubjectID]));
What is happening is, the code is not appending any rows to my table. The
message indicate '0' rows.
I've been playing around with the WHERE values without success and think it
must be something to do with the code.
Thanks in advance.
Tanya
I have a problem with an append query, the commandbutton is on a form in add
mode and I need to pick up parameter values from the form. I have also pasted
a copy of the append query:
Private Sub CmdNew_Click()
'Run Append Query
DoCmd.OpenQuery "qryAppendUnitstoStudentClass"
DoCmd.Close acDefault, "qryAppendUnitstoStudentClass"
'Begin New Record
DoCmd.GoToRecord , , acNewRec
End Sub
Append Query:
INSERT INTO tblCompetency ( StudentClassID, SubjectID, UnitID, ElementID,
PerformanceID )
SELECT tblStudentsClasses.StudentClassID, tblSubjects.SubjectID,
tblUnit.UnitID, tblElements.ElementID, tblPerformanceCriteria.PerformanceID
FROM ((tblSubjects INNER JOIN tblUnit ON (tblSubjects.SubjectID =
tblUnit.SubjectID) AND (tblSubjects.SubjectID = tblUnit.SubjectID)) INNER
JOIN (tblClasses INNER JOIN (tblStudents INNER JOIN tblStudentsClasses ON
tblStudents.StudentID = tblStudentsClasses.StudentID) ON tblClasses.ClassID =
tblStudentsClasses.ClassID) ON tblSubjects.SubjectID = tblClasses.SubjectID)
INNER JOIN (tblElements INNER JOIN tblPerformanceCriteria ON
tblElements.ElementID = tblPerformanceCriteria.ElementID) ON tblUnit.UnitID =
tblElements.UnitID
WHERE
(((tblStudentsClasses.StudentClassID)=[forms]![frmAddStudentstoClass]![StudentClassID]) AND ((tblSubjects.SubjectID)=[Forms]![frmClasses]![SubjectID]));
What is happening is, the code is not appending any rows to my table. The
message indicate '0' rows.
I've been playing around with the WHERE values without success and think it
must be something to do with the code.
Thanks in advance.
Tanya