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 / New Users / April 2006

Tip: Looking for answers? Try searching our database.

Using a Parameter Query: from VB.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed Warren - 29 Apr 2006 14:10 GMT
Query1

PARAMETERS DateStart DateTime, DateEnd DateTime;
SELECT DISTINCT FinalSchedule.Client_ID, FinalSchedule.CData
FROM FinalSchedule
WHERE (((FinalSchedule.Date) Between [DateStart] And [DateEnd]))
ORDER BY FinalSchedule.CData;

How does one call Query1 with parameters from VBA?

Thanks, Ed Warren.
Douglas J. Steele - 29 Apr 2006 14:40 GMT
Something like:

Dim qdfCurr As DAO.QueryDef
Dim rsCurr As DAO.Recordset

  Set qdfCurr = CurrentDb().QueryDefs("Query1")
  qdfCurr.Parameters("DateStart") = dtmStartDate
  qdfCurr.Parameters("DateEnd") = dtmEndDate
  Set rsCurr = qdfCurr.OpenRecordset

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)

> Query1
>
[quoted text clipped - 7 lines]
>
> Thanks, Ed Warren.
Ed Warren - 29 Apr 2006 18:27 GMT
Thanks, I was missing the .Parameter concept.

Ed Warren
> Something like:
>
[quoted text clipped - 17 lines]
>>
>> Thanks, Ed Warren.
 
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.