Recordset question


G

Garu

I am running below procedure on a data entry form but I get this error
(Runtime error 3021: No current record) when the form is closed empty (no
record entered). What is the function to use to check if there is no record
present?

Private Sub Form_Close()
Me.Recordset.MoveFirst
Do Until Me.Recordset.EOF
If Me.ChangeTYpe = "Vacation" Then
Me.QtrID = ""
ElseIf Me.ChangeTYpe = "Occupation" Then
Me.QtrID = Me.txtQtrNoOV.Value
End If
Me.Recordset.MoveNext
Loop
End Sub

Thanks,
Garu
 
Ad

Advertisements

N

NG

Hi,

If myrecordset.BOF and myrecordset.EOF

when both Begin Of File and End Of File are true then the recordset is empty
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

recordsets related questions 3
Recordsets 5
In(Recordset) 5
Recordset Object 4
Refresh recordset 1
recordset of Combobox 1
when to use a recordset? 9
Help with recordset please 3

Top