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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View Queried Data After Query Finished

Status
Not open for further replies.

Rickinrsm

Technical User
Nov 3, 2004
130
US
I'm trying to figure out a way to automatically view the datasheet results of this query on top of, or within a single page form when the query is finished.

It must be a simple thing, right?

Code:
Option Compare Database
Option Explicit

Private Sub Command14_Click()

End Sub

Private Sub QueryForReports_Click()
On Error GoTo Err_QueryForReports_Click

    Dim stDocName As String

    stDocName = "DuplicatesOcMonthlyData"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_QueryForReports_Click:
    Exit Sub

Err_QueryForReports_Click:
    MsgBox Err.Description
    Resume Exit_QueryForReports_Click
    
End Sub

Rick ~ Access Newbie
 
Rickinrsm,

In design view of the form, drag and drop the query on the form. Every time you openm the form you shall see your query result... after it finishes running.
 
In Form design, Access will not let me drag any objects from the database window to the form? Not queries or other tables.

Any ideas . . . ?

Rick ~ Access Newbie
 

R U sure????????

I just did it and actual it was a parameter query and run perfectly!

How did you try to do it?
 
Jerry - Okay I was able to drag and drop the query onto the form. This does work.

But each time I run the form the query runs and shows the results.

What I'm really looking for is to run the code I have shown in my original post above and THEN show tthe resaults in a datasheet on top of the form.

Thanks . . .

Rick ~ Access Newbie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top