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

Hiding query while showing results on a form

Status
Not open for further replies.

DellHater

Programmer
Nov 24, 2006
75
CZ
Hi
This is a total muppet question, I have not done any Access for 5 years and ca't remember how to do this !

I want to run a query (just based on 'build event options' then show the results on a form using the DoCmd etc.

However the query is still being displayed as well as the form (which displays correctly).
How do I stop the query result being displayed ?

Yes I know this is a noddy question but I can't figure it out, grey matter malfunction me thinks
 
I am not quite sure what you are saying. Perhaps you could post some code?
 
Hi
OK
This is what I am looking at
Option Compare Database

Private Sub Search_Click()
On Error GoTo Err_Search_Click

Dim stDocName As String

stDocName = "DBLoad Query"
DoCmd.OpenQuery stDocName
DoCmd.Close stDocName
stDocName = "Results"
DoCmd.OpenForm stDocName, acNormal
Exit_Search_Click:
Exit Sub

Err_Search_Click:
MsgBox Err.Description
Resume Exit_Search_Click

End Sub


Basically I want to click a button on a form, run a query and the form 'Results' to display the results of that query.
However at the moment the results of the query are displayed as well as the form.
How do I stop the query results being displayed

thanks
 
Perhaps:


Code:
Private Sub Search_Click()
On Error GoTo Err_Search_Click

    Dim stDocName As String

    stDocName = "Results"
    DoCmd.OpenForm stDocName, acNormal

Exit_Search_Click:
    Exit Sub

Err_Search_Click:
    MsgBox Err.Description
    Resume Exit_Search_Click
    
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top