Type mismatch error on report

dab1477

Registered User.
Local time
Today, 07:56
Joined
Jan 13, 2012
Messages
14
I have a database as follows:
Date1 Name Issue Action_Item1 Status1 Action_Item2 Status2 .....

with up to 5 max action items/status; where Status is a checkbox

I ONLY want the report to return records where there is text in an action_Item input AND the corresponding status is FALSE.

The issue I'm having is that there may be ACtion_Item inputs withOUT text; so I can't simply query the Status checkbox for false.

I have the following code:

Private Sub Report_Open(Cancel As Integer)
Dim Action_Item_1 As String
Dim Action_Item_2 As String
Dim Action_Item_3 As String
Dim Action_Item_4 As String
Dim Action_Item_5 As String
Where (Action_Item_1 Is Not Null And Action_item_1_Status = False) Or (Action_Item_2 Is Not Null And Action_Item_2_status = False) Or (Action_Item_3 Is Not Null And Action_Item_3_status = False) Or (Action_Item_4 Is Not Null And Action_item_4_status = False) Or (Action_Item_5 Is Not Null And Action_item_5_status = False)
End Sub

I am getting a compile error: Type Mismatch.

Any ideas?

Thanks,:confused:
 
Sorry you can't set criterias for the report on this way.
Look at the DoCmd.OpenReport Method in the Help file or search the Internet, to get an idea of how to do it.
Else use a query as record source for the report.
 
thanks. learned something. I will use the query route. Thanks for the assist.
 

Users who are viewing this thread

Back
Top Bottom