Full Version: Code to retrieve recordcount of query
UtterAccess Forums > Microsoft® Access > Access Forms
valkster
Hello, can someone help me with the basic code structure that will pull the recordcount from a saved query that is not currently in use? I have a menu screen with several menu choises that in turn open forms that users can use. I would like to display the recordcount for one of those menu choises on the main form in a textbox...this is to give the user a heads-up that there is information important to them without actually having to open that screen. Thanks in advance for any help.
Sincerely,
Mark
Jack Cowley
If DCount("*", "NameOfQuery") <> 0 Then
MsgBox "Query " & QueryName & " has data..."
End if
The first line is the important one...
hth,
Jack
valkster
That did the trick. I actually tied it to my textbox, like this.
txtcount=Dcount("*", "qryMeApprove")
It worked very well, thanks for the education on the DCount function.
incerely,
Mark
Jack Cowley
Mark -
You are most welcome and I am glad the suggestion worked for you... Continued success with your database...
Jack
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.