OK... I've been searching the forum for over an hour... this one seems simple, but can't find an answer. I think I am having a syntax problem.... but.... What I am trying to do is open a report to show only certain records... sounds simple enough.... BUT.......... Can't get it to ork when using 2 criteria.
The first....
Dim stDocName As String
Dim strWhere As String
strWhere = "[ProjectID]=" & Me![ProjectID]
stDocName = "rptClientBill"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport stDocName, acPreview, , strWhere
This works fine. But when I try to add a second criteria to it... I get different errors...
I want to add basically this..
([frmBillSubform].Form![HoursBilled]) = True
This pulls from a subform only the records after a checkbox is checked. (HoursBilled)
I have tried ..........
strWhere = "[ProjectID]=" & Me![ProjectID] & ([frmBillSubform].Form![HoursBilled]) = True
And..............
strWhere = "[ProjectID]=" & Me![ProjectID]
strWhere = strWhere & ([frmBillSubform].Form![HoursBilled]) = True
Still nothing works.... is this a syntax error??
The first....
Dim stDocName As String
Dim strWhere As String
strWhere = "[ProjectID]=" & Me![ProjectID]
stDocName = "rptClientBill"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport stDocName, acPreview, , strWhere
This works fine. But when I try to add a second criteria to it... I get different errors...
I want to add basically this..
([frmBillSubform].Form![HoursBilled]) = True
This pulls from a subform only the records after a checkbox is checked. (HoursBilled)
I have tried ..........
strWhere = "[ProjectID]=" & Me![ProjectID] & ([frmBillSubform].Form![HoursBilled]) = True
And..............
strWhere = "[ProjectID]=" & Me![ProjectID]
strWhere = strWhere & ([frmBillSubform].Form![HoursBilled]) = True
Still nothing works.... is this a syntax error??