Hi!
I create a module to move data from a query to a temp table. one record in the query will be several records in the temp table. I did this before and every thing was fine. but this time i got an error message "No current record". There is one record in the tblTemp after run the procedure. I can't figure out what causes this error, please help and thanks a lot in advance.
George
My code are as following:
Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT * FROM [qryCompTestWrongAnswer]"
rst.MoveFirst
'Open tblTemp which does not have any record
Set rst1 = db.OpenRecordset("tblTemp"
rst1.AddNew
rst1!Question = "1. ....."
rst1!Category = "Clinical"
rst1![#Wrong] = rst.[#Clinical1]
rst1![#TotalTests] = rst.#TotalTests
rst1.Update 'procedure stopped here!!
rst1.AddNew
rst1!Question = "2. ....."
rst1!Category = "Clinical"
rst1![#Wrong] = rst.[#Clinical2]
rst1![#TotalTests] = rst.#TotalTests
rst1.Update
...
rst1.Close
rst.close
I create a module to move data from a query to a temp table. one record in the query will be several records in the temp table. I did this before and every thing was fine. but this time i got an error message "No current record". There is one record in the tblTemp after run the procedure. I can't figure out what causes this error, please help and thanks a lot in advance.
George
My code are as following:
Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT * FROM [qryCompTestWrongAnswer]"
rst.MoveFirst
'Open tblTemp which does not have any record
Set rst1 = db.OpenRecordset("tblTemp"
rst1.AddNew
rst1!Question = "1. ....."
rst1!Category = "Clinical"
rst1![#Wrong] = rst.[#Clinical1]
rst1![#TotalTests] = rst.#TotalTests
rst1.Update 'procedure stopped here!!
rst1.AddNew
rst1!Question = "2. ....."
rst1!Category = "Clinical"
rst1![#Wrong] = rst.[#Clinical2]
rst1![#TotalTests] = rst.#TotalTests
rst1.Update
...
rst1.Close
rst.close