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 / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

Getting result of a query in a variable

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mieke.lamair@gmail.com - 09 Jul 2007 12:19 GMT
Hello,

I'm quite new to VBA and Access, but I want to get the result of a
select statement into a variable to be able to work with it.
The select statement will return only one value.

Can anyone help me on this?
Allen Browne - 09 Jul 2007 12:53 GMT
Use DLookup() to get the field from the query.

Explanation of how it works:
   Getting a value from a table: DLookup()
at:
   http://allenbrowne.com/casu-07.html
The article refers to a table, but you can put your query name where it
expects the name of the table.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I'm quite new to VBA and Access, but I want to get the result of a
> select statement into a variable to be able to work with it.
> The select statement will return only one value.
mieke.lamair@gmail.com - 09 Jul 2007 14:21 GMT
Thank you very much, I found it
 
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.