Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Integer in code (Access 2000)

    How can i replace the integer in a Where condition with an Integer froma select Case?
    In the following part of my code, where the number of the customer is written,, i want to write the integer Z as :

    Dim Z as Integer

    Select Case Me![Office]
    case 1
    z = 1
    case 2
    z = 2
    etc etc
    End Select

    But after writing the code as :
    AND ((customers.afid)= Z)

    If insread, i write say 2, then the report is OK

    the report is opened blank.Where am i wrong?

  2. #2
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Salem, Oregon, USA
    Posts
    219
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Integer in code (Access 2000)

    " AND ((customers.afid)= " & Z & ")"

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

    Re: Integer in code (Access 2000)

    Or even shorter

    "... AND ((customers.afid)= " & Me!Office & ")"

    in which case freelance can omit the entire Select Case statement.

  4. #4
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Salem, Oregon, USA
    Posts
    219
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Integer in code (Access 2000)

    V. true, if his "select case is one-for-one, as it seems!
    thx
    Pat

Posting Permissions

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