sql query vba dao
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Access VBA Training and help » SQL query in VBA for DAO recordset

SQL query in VBA for DAO recordset

resolvedResolved · Urgent Priority · Version 2003

replyReply Thu 30 Oct 2008, 23:15Delegate Paul said...

Paul has attended:
Access VBA course

SQL query in VBA for DAO recordset


Hi,
I can't seem to get the sql statement "qrystring" below quite right. It should be selecting the field [AssignedTo] from the query [QrySnapshotSummary] where the value of field [Assigned To team] in the same table equals the conent of combo box [cmbTeam] on the current form, called frmTeamKPIs. The results of this query become rstusers DAO recordset.

Please help.

Regards
Paul



Private Sub cmbTeam_Change()
Dim rstusers As DAO.Recordset
Dim intcount As Integer
Dim qrystring As String

Set db = CurrentDb

qrystring = "SELECT qrySnapshotSummary.AssignedTo FROM qrySnapshotSummary GROUP BY qrySnapshotSummary.AssignedTo, qrySnapshotSummary.[Assigned to team] HAVING (((qrySnapshotSummary.[Assigned to team])=Forms!frmTeamKPIs!cmbTeam));"
Set rstusers = db.OpenRecordset(qrystring)

For upcoming training course dates see: Pricing & availability

replyReply Mon 3 Nov 2008, 09:55Trainer Jacob said...

RE: SQL query in VBA for DAO recordset

Hi Paul

Further to your post we have had a look at this and this is something we can assist with in a consultative fashion as it is does exceed the scope of the forum.

We are confident that by following the steps below we can resolve your issue.
1) Forward your working files to us along with key objectives
2) We shall review and respond with estimate of cost
3) On agreement of scope and costs, we shall complete the work and return the files.

If you wish to discuss this further then please let us know.

Regards

Jacob

 

Please browse our web site to find out more about
microsoft database training and other Microsoft training courses.

Access tip:

Change case

To change case from upper or lower case, highlight the text area, hold down the Shift key and pres F3

View all Access hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard