Hi,
I have a dialogue for where the user selects two values from two combo boxes and type a number in a third text box. A command button on the form will execute a query to update a value in a table (partial code):
Code:
strSQL = "UPDATE tlkpGrades INNER JOIN (tblSchoolYears INNER JOIN tblJoinStudentsYears " _
& "ON tblSchoolYears.pkSchoolYears = tblJoinStudentsYears.fkSchoolYears) " _
& "ON tlkpGrades.pkGrades = tblJoinStudentsYears.fkGrades " _
& "SET tblJoinStudentsYears.TuitionFeesPrevious = 3500 " _
& "WHERE SchoolYear='" & Me.cboSchoolYear & "' " _
& "AND GradeLevel='" & Me.cboGradeLevel & "' "
Debug.Print strSQL
Debug.Print
db.Execute strSQL, dbFailOnError
Instead of the the amount 3500, I would like the value to be taken from a text box txtNewTuition on the form frmChangeTuition. I changed strSQL to the following:
Code:
strSQL = "UPDATE tlkpGrades INNER JOIN (tblSchoolYears INNER JOIN tblJoinStudentsYears " _
& "ON tblSchoolYears.pkSchoolYears = tblJoinStudentsYears.fkSchoolYears) " _
& "ON tlkpGrades.pkGrades = tblJoinStudentsYears.fkGrades " _
& "SET tblJoinStudentsYears.TuitionFeesPrevious = me.txtNewTuition " _
& "WHERE SchoolYear='" & Me.cboSchoolYear & "' " _
& "AND GradeLevel='" & Me.cboGradeLevel & "' "
Running the code shows the following error:
error 3061: Two few parameters. Expected 1.
Any idea how to fix this?
Thanks
Khalil