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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switch statement?

Status
Not open for further replies.

chuq2001

Programmer
Jul 15, 2002
24
US
I want to use a switch statement, but don't know correct syntax.

Like this
Code:
Switch(var)
    case  "NF"
         xxx=xxx
    case  "MW"
         xxx=xxx

I just need correct syntax

Chuck

 


Hint: ALT F11 > F1 > Contents > Language Reference > Functions

Here's the example found there (just wrap a field name in []'s to be sure it understands:

Switch(CityName = "London", "English", CityName _
= "Rome", "Italian", CityName = "Paris", "French")
Jeff Roberts
Analysis, Design, & Implementation
RenaissanceData.com
 
think this might be what you want....

Select Case Me![DataType]
Case "List"
Me.rptPrintComments.Report.Visible = True
Me.rptPrintCost.Report.Visible = False
Case "Cost"
Me.rptPrintComments.Report.Visible = False
Me.rptPrintCost.Report.Visible = True
End Select

this is just an example from some code i was using.
i know they call it switch in java. i think its called a select in VB

-mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top