sql query vba dao

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

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)

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

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Access tip:

Hiding Multiple Table columns

If you want to hide non-adjacent Access table columns. In Datasheet view, open the table that contains the columns you want to hide.

On the Format menu, click Unhide Columns.
In the Unhide Columns dialog box, clear the check box next to the name of each column you want to hide.
Click Close.

This method makes having to use the Hide Columns command repeatedly unnecessary

View all Access hints and tips


Server loaded in 0.07 secs.