Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with Case Statement? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I have the following code that works OK

    Now I want to make the code dynamic and want to replace: Case "701", "702"

    With: Case strCPRevCodes '"701", "702"

    The above statement does not work, what am I doing wrong?

    Thanks, John

    <pre>
    Dim strCPRevCodes As String

    strCPRevCodes = GetPref("Default CP Revenue Code")
    MsgBox "strCPRevCodes: " & strCPRevCodes

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

    Re: Problem with Case Statement? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Case strCPRevCodes results in a single case, not in two. You cannot do it this way.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Problem with Case Statement? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    After further review you and Charlotte gave me the solution in

    Help With Case Statement? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8) <post#=533,289>post 533,289</post#>

    I knew I saw it somewhere!

    <pre>If Contains(GetPref("Default CP Revenue Codes"), Me.lngRevGLDescID.Column(1)) = True Then

    strFilter = "[lngID]=" & Me.lngID
    If Me.Dirty Then
    DoCmd.RunCommand acCmdSaveRecord
    End If

    DoCmd.OpenForm "frm_POS_CommonsUsePermit", , , strFilter, , _
    acDialog, Me.Form.Name
    End If
    </pre>


    Thanks, John

Posting Permissions

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