On 12 May 2006 05:38:01 -0700, "kenshiro" <ri**********@yahoo.com>
wrote:
No Current Record occurs when you're trying to access a record and
there isn't any. For example your code has a MoveFirst call, but you
can't MoveFirst if there are no records. You need to test for that
BEFORE you MoveFirst. You can test with .RecordCount, or .EOF.
After .Update, there is no need to .MoveNext. The record will be added
during .Update, and next time you loop around another one will be
added, without the need to "move to an empty slot" if that was your
intention.
-Tom.
I got some great advice and changed the qdf.Parameters line to read:
qdf.parameters("prmAuditTool") = Me.txtAuditTool
I went into my query and added a parameter called prmAuditTool to the
query, and assigned that parameter to my AuditToolName field in the
query. This did the trick.
Now, my code breaks during the code to add new records to tblAnswers.
The code will add one new record to tblAnswers and tie it successfully
to the AuditID and QuestionID, but once the code hits the ".MoveNext"
line, it breaks. It gives me the error:
"No Current Record"
Is the code looking for an existing record? I want it to add a new
record, so do I need an extra line of code to add a new record?
Thanks,
Rich