Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    24

    Unanswered: automaticallt get values to pass through a query

    Is there a way to reference a value entered in a text box on a form so that it is automatically entered as a parameter in a query?

    Currently Access is popping up a window asking for this value when i actually want it to be read and entered from my form.

    Thanks

    Parma

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: automaticallt get values to pass through a query

    Originally posted by Parma
    Is there a way to reference a value entered in a text box on a form so that it is automatically entered as a parameter in a query?

    Currently Access is popping up a window asking for this value when i actually want it to be read and entered from my form.

    Thanks

    Parma
    Yes, use in your query (WHERE part)

    WHERE your field = Forms!yourFormName.yourTextBoxName


  3. #3
    Join Date
    Nov 2003
    Posts
    24
    Thanks but it isn't as simple as that i don't think.

    This is the query

    SELECT cd.CR_DEFECT_REF_NUM
    FROM CR_DEFECT AS cd
    WHERE (((Exists (SELECT NULL
    FROM CHANGED_ETL_OBJECTS ceo
    WHERE ceo.CR_DEFECT_REF_NUM = cd.CR_DEFECT_REF_NUM
    AND ceo.REPOSITORY = cp.FROM_REPOSITORY
    ))<>False)) OR (((cd.CR_DEFECT_REF_NUM) In (SELECT pi.CR_DEFECT_REF_NUM
    FROM PROMOTION_ITEMS pi
    ,CODE_PROMOTION cp
    WHERE pi.PROMOTION_ID = cp.PROMOTION_ID
    AND CP.TO_REPOSITORY = ceo.REPOSITORY
    AND cd.CR_DEFECT_REF_NUM NOT IN (
    SELECT pi.CR_DEFECT_REF_NUM
    FROM PROMOTION_ITEMS pi
    , CODE_PROMOTION cp
    WHERE pi.PROMOTION_ID = cp.PROMOTION_ID
    AND CP.TO_REPOSITORY =ceo.REPOSITORY
    )
    )));

    I want the value ceo.repository from the repository field in the changed etl objects table and the cp.FROM_REPOSITORY = forms!CODE_PROMOTION!FROM_REPOSITORY

    Have tried inserting this where clause but don't know where in the statement as i keep getting errors.

    Thanks for your help

Posting Permissions

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