Open report based on check box values

  • Thread starter Thread starter billybanter67
  • Start date Start date
B

billybanter67

Hi I want to open up one report and be able to change the criteria I
open it with.

Dim stDocName As String
stDocName = "MonthlyDataALL"

'opens report based on just debtor
If Me.ChkDebtor = -1 And Me.chkEstimator = 0 And Me.ChkBrand = 0 Then
DoCmd.OpenReport stDocName, acPreview, , "Debtor= forms!DataDrill!
Debtor"
End If

That works fine, now if I want the values of 2 check boxes I would
have thought that this might work but it doesn't.

'opens report based on debtor and estimator

'If Me.ChkDebtor = -1 And Me.chkEstimator = -1 And Me.ChkBrand = 0
Then
' DoCmd.OpenReport stDocName, acPreview, , "Debtor= forms!DataDrill!
Debtor" and "Estimator= forms!DataDrill!Estimator"
'End If

Any guidance?


Thanks
 
I see what I did wrong


DoCmd.OpenReport stDocName, acPreview, , "Debtor= forms!DataDrill!
Debtor" and "Estimator= forms!DataDrill!Estimator"

should not have the " after debtor and before the estimator

DoCmd.OpenReport stDocName, acPreview, , "Debtor= forms!DataDrill!
Debtor and Estimator= forms!DataDrill!Estimator"
 
Back
Top