Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / May 2005

Tip: Looking for answers? Try searching our database.

How to supress Query Parameter prompt dialogs?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Shaddick - 18 May 2005 19:05 GMT
Help please needed for the above.

I have a query (call it A) with Parameters defined in it( call them
ParmNameA1 and ParmNameA2), that uses two sub-queries (say B and C) each with
parameters as well.

I want to run query A using

DoCmd.OpenQuery A

and then supress the Parameter dialog boxes by filling in the parameters in
the code.

I have tried setting the Parameters programmatically using something like
this:

MYDB.QueryDefs("A").Parameters("TheParmNameA1").Value = "xxxx"
MYDB.QueryDefs("B").Parameters("TheParmNameB1").Value = "xxxx"

But I am still prompted for all the Parameters when the query executes.

By the way unfortunately the DB I am working with is Access 97.

Please help this is driving me batty.

Thanks

Signature

Paul Shaddick, MCP

Ofer - 18 May 2005 19:44 GMT
I like to run queries in a different way, I create an empty query called
GlobalQuery, and then I assign to it the string I want to run.
e.g

Function aaaaa(ParamNumber as long, ParamString as string )
Dim DBS As Database
Dim rst As Recordset, SqlStr As String

Set DBS = CodeDb
SqlStr = "SELECT * FROM MyTable Where Field1 =" & ParamNumber & " AND Field2
= '" & ParamString & "'"
DBS.QueryDefs("GlobalQuery").SQL = SqlStr

docmd.openquery "GlobalQuery"
End Function

Just a note, mybe you would like that.

> Help please needed for the above.
>
[quoted text clipped - 22 lines]
>
> Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.