Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How run query in the background

Status
Not open for further replies.

JavaToPerlNowVB

Programmer
Jul 14, 2005
84
US
Hi Everyone

I have this code in a form, and I want to run few queries before the report grab data from those queries. I am not sure, if i should do docmd.openquery "queryName" but this way the query will open for the user and i don't want that to happen.
Code:
Private Sub workDonePoles_Click()
On Error GoTo Err_workDonePoles_Click
Dim stDocName As String
Dim stLinkCriteria As String
'Run Query here
DoCmd.Echo True, "Preparing Report...Please Wait"
stDocName = "completedWorkPole"
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria

Exit_workDonePoles_Click:
    Exit Sub

Err_workDonePoles_Click:
    MsgBox Err.Description
    Resume Exit_workDonePoles_Click
End Sub

Thanks alot
 
what type of queries do you want to run before opening the report? most probably update queries, no?
you can run update queries through code via
Code:
docmd.openquery "myupdatequery"
and the user qon't notice anything of it ...

HTH,
fly

[blue]Typos, that don't affect the functionality of code, will not be corrected.[/blue]

Martin Serra Jr.
[blue]Database_Systems and _Applications shared across all Business_Areas[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top