Set variables inside loop

Results 1 to 2 of 2

Thread: Set variables inside loop

  1. #1
    Join Date
    Dec 1969

    Default Set variables inside loop

    I have a question that can probably be answered fairly easily. I want to set a series of variables inside a loop to prevent me from a lot of code duplication. Basically the user defines five variables in a form. When processing them I want to do the same select/case statement for each of the five variables. I want an easy, efficient and fast way to do this.<BR><BR>This is the basic select/case statement.<BR><BR>Select Case strSearchColumnOne<BR>Case "BeginDate"<BR>strSearchColumnOneHeader = "Date:"<BR>Case "BeginTime"<BR>strSearchColumnOneHeader = "Begin Time:"<BR>Case "EndTime"<BR>strSearchColumnOneHeader = "End Time:"<BR>Case "Length"<BR>strSearchColumnOneHeader = "Length:"<BR>Case "None"<BR>strSearchColumnOneHeader = ""<BR>End Select<BR><BR>I need to do this for SearchColumnOneHeader through SearchColumnFiveHeader. There must be an easier way then using 5 seperate select/case statements...? Help! Thanks!

  2. #2
    Join Date
    Dec 1969

    Default RE: Set variables inside loop

    Pass the strSearchcolumnone or two or whatever into a function that is like your select statement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts