dont want dynaset to be visible (1 Viewer)

pungentSapling

NeedHotSauce?
Local time
Yesterday, 20:59
Joined
Apr 4, 2002
Messages
116
I have a timecard database and I am running a series of queries that determine if entries have been missed for any individual(s).

The first query determines who should have entries
the second query determines what entries have been made
the third is a mismatch query that determines who has been missed.


DoCmd.OpenQuery "qryMissedEntries1"
DoCmd.OpenQuery "qryMissedEntries2"
DoCmd.OpenQuery "qryMissedEntriesC"

If DCount([Employee Number], "qryMissedEntriesC") > 0 Then
MsgBox "You Missed Some"
End If

The above message box will eventually contain the names of the missed employees.

The problem is that I do not want these queries to show up on the screen.
Is there a way to just run them and not display them?
Or should I just have them close after I generate my message box?
thanks p
 

Jon K

Registered User.
Local time
Today, 01:59
Joined
May 22, 2002
Messages
2,209
Open the queries as recordsets.
 
Last edited:

pungentSapling

NeedHotSauce?
Local time
Yesterday, 20:59
Joined
Apr 4, 2002
Messages
116
ty

thanks again
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:59
Joined
Feb 19, 2002
Messages
43,352
Running the queries in this manner serves no purpose. The DCount() function will run query c (which I presume runs queries 1 and 2) to obtain the requested result. Running them separately, in advance, is redundant.
 

Jon K

Registered User.
Local time
Today, 01:59
Joined
May 22, 2002
Messages
2,209
Yes, if dcount() is only for testing whether any records are returned from qryMissedEntriesC, use the recordset's EOF property for the testing.

And if qryMissedEntriesC is based on the other two queries, there is no need to open them.

Thanks Pat
 

pungentSapling

NeedHotSauce?
Local time
Yesterday, 20:59
Joined
Apr 4, 2002
Messages
116
Yes, Indeed
Thankyou. Marvelous how that works isn't it.
I am only using C now.

How about making all the records in qryMissedEntriesC show up in a message box.

Right now I have it so the dynaset shows up on the screen, but I would rather have a message box that contains the names of the missed employees.

Should I be using a Dynamic Array?
to declare each variable(employeeName)
or this a job for
For...Next

Or is this job better suited to a form with a list Box?

Thanks again,
p
 

Users who are viewing this thread

Top Bottom