projecttoday
Programmer
I am trying to add some new records to a table from records in another table. (This cannot be avoided). So, it's a read-write loop, given below. On the Currentdb.Execute statement I get the error message "Too few parameters, expected 1". Does anyone know how to correct this? Robert
SQLstr = "SELECT modelid FROM tblReservations WHERE reservationsmainid = " & Forms.frmreslist.lstReservations
Set db = CurrentDb()
Set rs = db.OpenRecordset(SQLstr)
rs.MoveFirst
Do Until rs.EOF
SQLstr = "INSERT INTO tblRentaldetails (rentalid) VALUES (ShowIdentity)"
CurrentDb.Execute SQLstr, dbFailOnError '< I get error here
rs.MoveNext
Loop
SQLstr = "SELECT modelid FROM tblReservations WHERE reservationsmainid = " & Forms.frmreslist.lstReservations
Set db = CurrentDb()
Set rs = db.OpenRecordset(SQLstr)
rs.MoveFirst
Do Until rs.EOF
SQLstr = "INSERT INTO tblRentaldetails (rentalid) VALUES (ShowIdentity)"
CurrentDb.Execute SQLstr, dbFailOnError '< I get error here
rs.MoveNext
Loop