Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If Then Else (2k)

    Good Morning Everyone,

    I will try to keep this simplistic.....Here goes...

    My form has several combo boxes....
    1)cboRequestType which has 2 choices, "Inpatient" and "Concurrent"
    2)cboReviewType which has 3 choices, "CaseMgmt", "HomeHealth" and "Inpatient"
    3)cboSurveyResults which has 4 choices for the user
    4)cboAdditionalContacts which has 2 choices for the user
    5)lstFacility which has 10 choices for the user

    Here's the situation...the user chooses cboRequestType, either "Initial" or Concurrent then cboReviewType is visible giving the user 3 choices, "CaseMgmt", "HomeHealth" or "Inpatient"....depending on the choice from cboRequestType and the choice in cboReviewType, then one or another combo will
    appear...then depending on the choice from that combo, the user is directed to another FORM.

    I've attached the following code and would like to know if this can be more simplistic.

    Or if I'm even doing it right...can someone please voice you opinion?

    Thanks in advance.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: If Then Else (2k)

    There are some problems with your code:

    If Me.cboRequestType.Column(0) = 1 Or 2 Then

    is not valid, it should be

    If Me.cboRequestType.Column(0) = 1 Or Me.cboRequestType.Column(0) = 2 Then

    but the If Then Else logic is inconsistent too. It's probably better to use nested Select Case statements:

    Select Case Me.cboRequestType
    Case 1
    Select Case Me.cboReviewType
    Case 1
    ' ...
    Case 2
    ' ...
    Case 3
    ' ...
    End Select
    Case 2
    Select Case Me.cboReviewType
    Case 1
    ' ...
    Case 2
    ' ...
    Case 3
    ' ...
    End Select
    End Select

Posting Permissions

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