Results 1 to 8 of 8
  1. #1
    iamraja5 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    16

    Query NOT taking the two parameters WHY?

    Hi All

    I have a access 2007 form with two objects,
    1) One combo Box with two operators I.e Less than < and > greater than Sign.
    2) second Text Object with Qty I.e 50

    All I am doing here is, the user can select greater than or less than sign and enter his/own qty for search

    In the qty query field,
    I have done like this,


    >[Forms]![TAN Main]![units]

    this is workign only if I hard coded the operator >, I want to select both the operator sign and the qty to gather. How do I connect both form objects in a query?

    Please help
    Thank you

  2. #2
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    It's impossible to give you advice without the actual problematic query.

  3. #3
    iamraja5 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    16
    Hi Here is the query,
    >[Forms]![TAN Main]![units]

    ">" is the greater than sign or "<" less then sign is coming from a combo box in the form where user can select, and units in the text box in the form as well.

    I have hard coded the ">" , how I can enter in the query block togather with
    [Forms]![TAN Main]![units]

    I tired this way
    [Forms]![TAN Main]![operato] & [Forms]![TAN Main]![units]

    I got the error msg as " you have tried a complex mathematicl,,simplify"

    I know I am missing something, but not sure what it is..

    Please help.

    Raja

  4. #4
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    Try this:
    Code:
    chr(34) & [Forms]![TAN Main]![operato] & chr(34) & [Forms]![TAN Main]![units
    that is, enclose a string reference in quotation marks.

  5. #5
    iamraja5 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    16
    mmm, I tired
    Chr(34) & [Forms]![TAN Main]![operato] & Chr(34) & [Forms]![TAN Main]![units]

    Still got the same error msg." too complex to evaluate...."

    any other method?
    thanks

  6. #6
    llkhoutx is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Jan 2010
    Location
    Houston, Texas USA
    Posts
    373
    What is the entire SQL string of your query? You've only provided part of a filter.

  7. #7
    iamraja5 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    16
    Hi
    Here is the SQL code
    SELECT DISTINCT Sum(MARC_LOAD.QTY) AS SumOfQTY
    FROM MARC_LOAD INNER JOIN MARC_CONTAINER ON MARC_LOAD.CONT_NO = MARC_CONTAINER.CONT_NO
    HAVING (((Sum(MARC_LOAD.QTY))=Chr(34) & [Forms]![TAN Main]![operato] & Chr(34) & [Forms]![TAN Main]![units]));



    Thanks

  8. #8
    iamraja5 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2010
    Posts
    16

    Qurry Still not taking the values-attachd the DB

    Hi all

    I have attached the Database. The Query is still erroring out.
    The user will select the operator ( i.e Greater than or less than, etc) and will enter the units in the form.

    when hit the submit, there is a query running. The query is not taking the two selections(parameter) from the form.

    Please help me how to enter the criteria linked to he form?

    thanks alot
    Last edited by iamraja5; 03-16-2010 at 09:13 AM.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Too few parameters. Expected 2.
    By PPCMIS2009 in forum Access
    Replies: 0
    Last Post: 01-28-2009, 01:02 PM
  2. Add query parameters in with vbCode?
    By ~SwAmPdOnKeY~ in forum Programming
    Replies: 0
    Last Post: 08-07-2008, 07:58 PM
  3. Access Novice Taking On Large Project - Need Guidance
    By gtangjr in forum Database Design
    Replies: 1
    Last Post: 04-04-2008, 08:41 PM
  4. Replies: 0
    Last Post: 02-15-2007, 03:07 PM
  5. Taking an access database online
    By anthony_f_justin in forum Access
    Replies: 2
    Last Post: 12-29-2005, 01:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums