I have created a database application that uses a macro, activated by a
button click event, that runs a query which returns a recordset
consisting of a subset of the matching database record, and displays the
data within a form. The query on the table produces a recordset based
on the matching criteria consisting of a person's first and last name,
or fields ClientFirstname and ClientLastname, respectively. I've
programmed the application to display the recordset in the form only if
a third field, AgentName, in the record has a null value. If the
AgentName field is not null, then no record is displayed because the
query will return a null recordset.
Now, with this backdrop, here is my goal: I'm trying to determine the
VBA code that would determine whether a recordset returned by a query is
null or not. Then, if the recordset is null, I want to have other VBA
code run an another query to yield the same subset of data fields and
display them in a replica of the first form, but this time, I want to
display the actual value of the AgentName field along with the other
data in the record as defined by the form. I hope this is clear.
Essentially, what I need to know this: what is the syntax of VBA code
that can be used to determine whether or not a recordset returned by a
query is null or not null? Thanking anyone in advance for their help
with this problem.