Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning multiple strings to a Dim'd variable

Status
Not open for further replies.

dgirl1010

Technical User
Jul 14, 2006
20
0
0
US
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.

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
 
stOpenCriteria = "PhaseDescription IN ('In Requirements','Analysis','Design','Development','Pre-Requirements')"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top