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

Select Case with IF, Then 1

Status
Not open for further replies.

MICKI0220

IS-IT--Management
Jul 20, 2004
337
US
How can I code a case select statement with if/then's in them. Case statements are not my strong point, but it seems like in this situation it may work best.

I have 8 types of billing. I want to use a case statement to select the type of billing....example

Select Case Bill_IDType
Case Bill_IDType 1
Case Bill_IDTYPE 2 etc. up to Bill_IDType 8

Once in a Case selection, I need to have some criteria checked.
No matter what case is selected , then I need to check to see if TransType is L or P. If L is the answer it needs to check to see if Paid_on is P or B. after these checks it edits the record based on the initial case (The case will indicate the percentage to be multiplied on)

Can someone give me an example of how to do this?
 


hi,

Is Bill_IDType a NUMERIC variable or STRING?

Assuming that it is a STRING...
Code:
Select Case Bill_IDType
  Case "1"
     Select Case TransType
       Case "L"

       Case "P"

     End Select
  Case "2"   

  Case "8"

  Case Else
    'you only need this IF there is a need to do something in the event that Bill_IDType is something other than 1 to 8
End Select
If Bill_IDType is numeric and if Bill_IDType 2, 4, 6 & 8 had something in common...
Code:
Select Case Bill_IDType
  Case 1
     Select Case TransType
       Case "L"

       Case "P"

     End Select
  Case 2, 4, 6, 8
     Select Case TransType
       Case "L"

       Case "P"

     End Select
  

  Case 3

  Case 5

  Case 7

  Case Else
    'you only need this IF there is a need to do something in the event that Bill_IDType is something other than 1 to 8
End Select



Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 


yes or use Ifs. Depends on the circumstance.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top