tomking505
New member
- Local time
- Today, 07:53
- Joined
- Oct 7, 2010
- Messages
- 5
I know just enough to be dangerous, but clearly not enough to be useful.
My WHERE clause in the following DoCmd.OpenReport statement doesn't work
The select statement that relates all the tables is in a query, and the query name is listed in the reports Record Source.
Any ideas, friends?
Thanks,
Tom
My WHERE clause in the following DoCmd.OpenReport statement doesn't work
Code:
Option Compare Database
Public Function Closer2()
Dim MyDB As DAO.Database
Dim rstParseNames As DAO.Recordset
Dim stJustOne
Set MyDB = CurrentDb
Set rstParseNames = MyDB.OpenRecordset("Clients", dbOpenDynaset)
With rstParseNames
If Not .BOF And Not .EOF Then 'has at least 1 Record
Do While Not .EOF
stJustOne = ![Clientid]
MsgBox stJustOne
'next line: msgbox increments correctly, report always shows first Client in table
DoCmd.OpenReport "All Checklists Report2", acViewNormal, , ![Clientid] = stJustOne, acDialog
.MoveNext
Loop
Else
'fall through
End If
End With
rstParseNames.Close
Set rstParseNames = Nothing
End Function
The select statement that relates all the tables is in a query, and the query name is listed in the reports Record Source.
Any ideas, friends?
Thanks,
Tom