Experts, I have some code in Microsoft Access that works fine when my table has data in it.
The problem is when this table is empty.
It errors out at: rs4.MoveFirst.
What is the cleanest way to end this look if Table TEMP_QSTNT_SELECTION has no records in it?
Set rs4 = CurrentDb.OpenRecordset("Select QSTNT_SELECTION_PID From TEMP_QSTNT_SELECTION")
Do Until rs4.EOF
NewZ = NewZ + 1
NewSelVer = rs4(0)
sSQL3SW = "INSERT INTO TEMP_QSTNT_SELECTION_SWAP(OLD_PID,NEW_PID) VALUES(" & NewSelVer & "," & NewZ & ")"
CurrentDb.Execute sSQL3SW, dbFailOnError
NewSelVer = NewSelVer + 1