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

    Survey Report (A2K)

    I have the following code to compare to values based on a question in a report. The question no matter what survey record it is but the response value can be different.

    <blockquote><hr>Private Sub Report_Open(Cancel As Integer)
    Dim stQuestion As String

    stQuestion = "Last Question"
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Survey Report (A2K)

    There are two problems:

    1) In

    Select Case "Last Question"

    you have a constant value between quotes. This doesn't make sense. You should have something that can change, for example a variable, after Select Case.

    2) Code such as

    If stQuestion = 1 Or 2 Or 3 Then

    will not do what you want/expect. Correct versions are

    If stQuestion = 1 Or stQuestion = 2 Or stQuestion = 3 Then


    Select Case stQuestion
    Case 1, 2, 3

    Note: it's strange to use a string variable to hold number values.

Posting Permissions

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