Please bear with me, I'm still learning VBA.
I have a form that allows a user to select how they want to view a report (Open items, closed items, on-hold items etc). In the "Open" category there are several statuses that need to be included on the "Open Items" report. I'm using a select case to allow the user to pick "open" but I need that to tell the database to include all of the "open" statuses but none of the other statuses. So I created a variable stOpenCriteria to use for that case, but I'm having trouble assigning more than one status to it. It'll work if I only have one status listed, but I can't figure out the syntax to use more than one.
I have a form that allows a user to select how they want to view a report (Open items, closed items, on-hold items etc). In the "Open" category there are several statuses that need to be included on the "Open Items" report. I'm using a select case to allow the user to pick "open" but I need that to tell the database to include all of the "open" statuses but none of the other statuses. So I created a variable stOpenCriteria to use for that case, but I'm having trouble assigning more than one status to it. It'll work if I only have one status listed, but I can't figure out the syntax to use more than one.
Code:
Dim stPhaseCriteria As String
Dim stOpenCriteria As String
[highlight]stOpenCriteria = "[PhaseDescription]=""In Requirements"" OR ""Analysis"" OR ""Design"" OR ""Development"" OR ""Pre-Requirements"""[/highlight]
Select Case Me.fraPhaseChoice
Case 1
stPhaseCriteria = "[PhaseDescription]=""Completed"""
Case 2
stPhaseCriteria = "[PhaseDescription]=""Cancelled"""
Case 3
stPhaseCriteria = "[PhaseDescription]=""On Hold"""
Case 4
stPhaseCriteria = stOpenCriteria