Determine position in query recordset

G

Gert

Hi,
I am creating a function that I want to use in a query.
I need to test in the function whether the recordset is BOF.
How do I refer to the recordset from VBA - what is the object name?
Gert
 
M

Marshall Barton

Gert said:
I am creating a function that I want to use in a query.
I need to test in the function whether the recordset is BOF.
How do I refer to the recordset from VBA - what is the object name?


The object name of a recordset is whatever name you used
when you opened the recordset.

If that doesn't make sense, it's because your question seems
to be twisted into a knot. A recordset is the result of a
query, not something that partially exists while a query is
building its result.

If you are trying to create a recursive query, forget it.

If you want to know if the query returns no records, then
you should open a recordset on the query and check the
recordset's RecordCount property.

If you want to know if a form/report will have records to
display before opening the form/report, then use something
along the lines of:

If DCount("*","thequery") > 0 Then
DoCmd.OpenForm . . .

If all my guesses about what you are trying to do are off
the mark, you should back up a step and explain WHAT you are
trying to accomplish instead of asking questions about how
you thought you could do it.
 

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

Top