Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    May 2004
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Zeros in criteria (Access 2000)

    Edited by HansV to make subject more descriptive for future searches than just "Access 2000"

    Hello,
    I have a question about zeros(0). I have a form that when you select a value in a combo box it is passed as criteria to a query when a command button is clicked. This all works perfectly except that when I select say 10 I also get all the 100, 1000 and 100K parts displayed and not just the 10. Is there some issue with trailing zeros. I am sorry about the vagaries. If anybody can help it would be very much appreciated.

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

    Re: Zeros in criteria (Access 2000)

    It depends on what the criteria look like. There is no special handling of trailing zeros, but if the criteria are like this (with the appropriate names)

    <code>Like [Forms]![frmMyForm]![cboMyCombo] & "*"</code>

    the query will return all records for which the field begins with the item selected in the combo box. If this is not what you want, change the criteria to

    <code>[Forms]![frmMyForm]![cboMyCombo]</code>

    again, with the appropriate names substituted. If this does not help, please provide details about the query and the code behind the command button.

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Zeros in criteria (Access 2000)

    When you pass this value to a query, what are the paramters on the value. For example are you using a like clause such as Like 1 and * such that you get everything starting with a one. There shouldn't be an issue with trailing zero's as these numbers are unique.

    In your query, how do you reference the number being passed from the form?
    Regards,

    Gary
    (It's been a while!)

  4. #4
    Star Lounger
    Join Date
    May 2004
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Zeros in criteria (Access 2000)

    Thanks Gary. That is what the problem was I did have a Like clause and that was causing my issue. Again thanks for the reply.

  5. #5
    Star Lounger
    Join Date
    May 2004
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Zeros in criteria (Access 2000)

    Thank you Hans you are always of great help. I had a Like clause in the query and that was causing my issue thanks again

Posting Permissions

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