Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    failed constant (Access 2000)

    I have a constant that is working in all my cases except one, and i wonder why.
    My constant is called StrIn :
    Public Const strIn = " 12,443,859,870,878,893,894,896,899,907,911,914,915 ,918,926,933,936,939,940,577,238"
    This constant refers to a given number of Customer Id.

    My constant is not working in the follwing case

    i want to replace " AND ((customers.Customerid) In (2,4,6))" with " & strIn & " as :

    "AND ((customers.Customerid) " & strIn & "))"

    But i receive error.

    The above code is a part of a wider code as follows:



    " WHERE (((customers.afid)=1) AND ((customers.Customerid) In (2,4,6)) AND ((products.size)<6) AND ((orders.paymentid)=True) AND ((Year([InvoiceDate]))=2002))" & _
    ut the following givesd the error:
    " WHERE (((customers.afid)=1) AND ((customers.Customerid) " & strIn & ")) AND ((products.size)<6) AND ((orders.paymentid)=True) AND ((Year([InvoiceDate]))=2002))" & _


    I want to apply the constant in the above code but i cant.SInce my constant works in all other cases,
    i suppose th error might be with brackets or something of the sort.
    I will be grateful for any help

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: failed constant (Access 2000)

    You have no In in your new statement.
    Also I'm wondering if you have to add the parentheses.
    " WHERE (((customers.afid)=1) AND ((customers.Customerid) In ( " & strIn & "))) AND ...
    Francois

Posting Permissions

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