DSCartwright
Registered User.
- Local time
- Today, 14:52
- Joined
- Jul 30, 2012
- Messages
- 16
Hi, Basically I want to use the record set query to highlight and bypass any records which don't contain any data, I initially tried to do this but it did not like the queries which where set up in the form. What I am unsure of is how to embed my SQL query into the the recordset function as it is throwing out errors, this is the first time i have tried to use this so apologies if my question is a little vague. But here is what I am working on. Also should mention this needs to be Access 2000 compatible. regards
(This is what i currently have, this is the SQL statement i would like to embed into Set MySet = MyDb.OpenRecordset)
Code:
Private Sub preview_Click()
On Error GoTo Err_preview_Click
count_valid_matters
Dim docname As String
Dim criterion As String, MyDb As Database, MySet As DAO.Recordset
Set MyDb = DBEngine.Workspaces(0).Databases(0)
Set MySet = MyDb.OpenRecordset("Parameters", DB_OPEN_DYNASET)
(This is what i currently have, this is the SQL statement i would like to embed into Set MySet = MyDb.OpenRecordset)
Code:
SELECT matters.[counter-mt], [Client-ct] & " " & [Surname-ct] & " " & [Forenames-ct] & ":" & Format([Matter-mt],"0000") & "-" & [Description-mt] AS [No], [Surname-ct] & " " & [Forenames-ct] & ":" & Format([Matter-mt],"0000") & "-" & [Description-mt] AS Name
FROM ((([Parameters] INNER JOIN practice ON Parameters.[practice-us] = practice.[practice-co]) INNER JOIN clients ON practice.[practice-co] = clients.[Practice-ct]) INNER JOIN matters ON clients.[counter-ct] = matters.[counterct-mt]) INNER JOIN timetran ON matters.[counter-mt] = timetran.[countermt-tt]
WHERE (((timetran.[date-tt])>=[forms]![billing guide form]![startdate-s] And (timetran.[date-tt])<=[forms]![billing guide form]![enddate-s]) AND ((timetran.[billedstatus-tt])<>[Forms]![billing guide form]![excludebilled-s]))
GROUP BY matters.[counter-mt], [Client-ct] & " " & [Surname-ct] & " " & [Forenames-ct] & ":" & Format([Matter-mt],"0000") & "-" & [Description-mt], [Surname-ct] & " " & [Forenames-ct] & ":" & Format([Matter-mt],"0000") & "-" & [Description-mt];
Last edited: