Hi
I do have a form called booking, when user should be able to type a booking number in text box and by clicking on the Find button then all the details for this booking should be displayed.
My problem is when I type the number and click on Find I will get this error message
[Run time error ‘3021’;
Either BOF or EOF is True, or the current record has been deleted; the
operation requested by the application requires a current record.]
By clicking on Debug it will highlight this line [dtacustomer.Recordset.MoveNext] in the profind function.
Any Idea why I do get this error.
Below is the code which I am using.
Kind Regards
HB25

Private Sub cmdfind_Click()
dtabooking.Recordset.MoveFirst
While txtbooking <> txtfind And dtabooking.Recordset.EOF = False
dtabooking.Recordset.MoveNext
Wend
profind
End Sub

This is in the profind function code

Public Sub profind()
dtacustomer.Recordset.MoveFirst
While txtcustomer <> txtcustomerNo
dtacustomer.Recordset.MoveNext
Wend
dtaRoom.Recordset.MoveFirst
While txtroom <> txtroomNo
dtaRoom.Recordset.MoveNext
Wend
Call MakeVisible
End Sub

you need to check if BOF or EOF properties are TRUE before using the move methods.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.