Hello, I receive the following error:
Run-time error '-2147217904 (80040e10)': No value given for one or more required parameters
when running the following code:
Set rs1 = db.OpenRecordset("SELECT * FROM tblNewStudentLog")
Do
rs1.MoveFirst
sql1 = "SELECT tblStudent.StudID, tblStudent.HousingNum, tblStudent.PID, tblStudent.FName, tblStudent.LName, tblStudent.City, " & _
"tblStates.Abrv AS State, tblStudent.Zip, tblStudent.Suffix, tblStudent.Address, tblStudent.address2, tblStudent.RefID, " & _
"tblStudent.StatusID, tblStudent.StateID, tblInstitution.Institution FROM (tblStudent LEFT JOIN tblStates " & _
"ON tblStudent.StateID = tblStates.StateID) LEFT JOIN tblInstitution ON tblStudent.InstutID = " & _
"tblInstitution.InstutID WHERE (((tblStudent.PID)=" & _
"" & rs1![PID] & ") AND ((tblStudent.FName)= " & SQLFixup(rs1![FName]) & "));"
rs3.Open sql1, Application.CurrentProject.Connection, adOpenStatic, adLockPessimistic
[rest of code]...
The funny thing is the correct values for rs1![PID] and rs1![FName] are showing in debug mode, and I can also run the sql statement alone just fine using these values, verifying that all column/field headings are spelled correctly.
Any suggestions would be very welcome, I've never received this error before. Thanks!
Run-time error '-2147217904 (80040e10)': No value given for one or more required parameters
when running the following code:
Set rs1 = db.OpenRecordset("SELECT * FROM tblNewStudentLog")
Do
rs1.MoveFirst
sql1 = "SELECT tblStudent.StudID, tblStudent.HousingNum, tblStudent.PID, tblStudent.FName, tblStudent.LName, tblStudent.City, " & _
"tblStates.Abrv AS State, tblStudent.Zip, tblStudent.Suffix, tblStudent.Address, tblStudent.address2, tblStudent.RefID, " & _
"tblStudent.StatusID, tblStudent.StateID, tblInstitution.Institution FROM (tblStudent LEFT JOIN tblStates " & _
"ON tblStudent.StateID = tblStates.StateID) LEFT JOIN tblInstitution ON tblStudent.InstutID = " & _
"tblInstitution.InstutID WHERE (((tblStudent.PID)=" & _
"" & rs1![PID] & ") AND ((tblStudent.FName)= " & SQLFixup(rs1![FName]) & "));"
rs3.Open sql1, Application.CurrentProject.Connection, adOpenStatic, adLockPessimistic
[rest of code]...
The funny thing is the correct values for rs1![PID] and rs1![FName] are showing in debug mode, and I can also run the sql statement alone just fine using these values, verifying that all column/field headings are spelled correctly.
Any suggestions would be very welcome, I've never received this error before. Thanks!