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 / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

How do I set global variables in an Access Database Project(ADP)?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
huddie - 29 Sep 2006 15:59 GMT
I'm using Access with SQL Server 2000 to develop a database, and want to set
global Transact SQL variables, but I don't know how.  How do a set a variable
that can be seen by any query, etc., in the database ?

Signature

--
Paul Anderson

Klatuu - 29 Sep 2006 16:50 GMT
In Access, variables can't be seen by SQL at all.
The easiest way to do this is create a form with a text box control for each
value you want to pass to a query.  Make the Default Value property of each
control the value you want to pass to the query. The form can be hidden, but
will need to be open at any time you want to use a query that references it.
(Having a form always open has some other valuable uses as well, but I
digress)
Queries can reference controls on a form.  So, as an example:

WHERE [SOME_FIELD] = [Forms]![NameOfForm]![NameOfControl]

> I'm using Access with SQL Server 2000 to develop a database, and want to set
> global Transact SQL variables, but I don't know how.  How do a set a variable
> that can be seen by any query, etc., in the database ?
 
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.