Recordset question

  • Thread starter Thread starter Garu
  • Start date Start date
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
 
Hi,

If myrecordset.BOF and myrecordset.EOF

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