Enter Parameter Value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ngweixiong
    New Member
    • May 2007
    • 26

    Enter Parameter Value

    Hi,

    I have a query to check for condition. but when i execute, a message box apprear. "Enter Parameter Value"

    below is my code.
    Code:
    Stat: IIf([AvgOfTL PO and Inv]<7,[StatA],IIf([AvgOfTL PO and Inv]<10,[StatB]))
  • puppydogbuddy
    Recognized Expert Top Contributor
    • May 2007
    • 1923

    #2
    Originally posted by ngweixiong
    Hi,

    I have a query to check for condition. but when i execute, a message box apprear. "Enter Parameter Value"

    below is my code.
    Code:
    Stat: IIf([AvgOfTL PO and Inv]<7,[StatA],IIf([AvgOfTL PO and Inv]<10,[StatB]))
    If [StatA] and [StatB] are textboxes on your form, you need to provide a full reference as shown. Replace yourForm with the actual name of your form.

    Code:
    Stat: IIf([AvgOfTL PO and Inv]<7,Forms!YourForm![StatA],IIf([AvgOfTL PO and Inv]<10,Forms!YourForm![StatB]))

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32664

      #3
      What's the prompt in the Message Box?

      Comment

      • ngweixiong
        New Member
        • May 2007
        • 26

        #4
        Originally posted by puppydogbuddy
        If [StatA] and [StatB] are textboxes on your form, you need to provide a full reference as shown. Replace yourForm with the actual name of your form.

        Code:
        Stat: IIf([AvgOfTL PO and Inv]<7,Forms!YourForm![StatA],IIf([AvgOfTL PO and Inv]<10,Forms!YourForm![StatB]))

        Hi,

        I don't have any form in my Ms Access.

        All i have is tables and query.

        Comment

        • ngweixiong
          New Member
          • May 2007
          • 26

          #5
          Originally posted by NeoPa
          What's the prompt in the Message Box?

          Hi,

          the prompt is " Enter Parameter Value"

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32664

            #6
            You should have a Title (Enter Parameter Value), then a Prompt (?), then a box to enter your value in.
            What is the Prompt?

            Comment

            • ngweixiong
              New Member
              • May 2007
              • 26

              #7
              Originally posted by NeoPa
              You should have a Title (Enter Parameter Value), then a Prompt (?), then a box to enter your value in.
              What is the Prompt?


              Hi,

              the prompt is Stat A and Stat B

              Comment

              • ngweixiong
                New Member
                • May 2007
                • 26

                #8
                Originally posted by ngweixiong
                Hi,

                the prompt is Stat A and Stat B

                SOrry,

                what i mean is, firstly the prompt is Stat A, then after pressing enter,
                it come out another prompt which is Stat B.

                hope it will be clearer.

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32664

                  #9
                  Right, in that case you are missing both of those fields from your query input.
                  As you have spelled them differently even here between two of your own posts, I think it very likely that you have done the same in your query. Check the spellings. Are they [StatA] or are they [Stat A]?
                  Do the same for [StatB] of course.

                  Comment

                  • ngweixiong
                    New Member
                    • May 2007
                    • 26

                    #10
                    Originally posted by NeoPa
                    Right, in that case you are missing both of those fields from your query input.
                    As you have spelled them differently even here between two of your own posts, I think it very likely that you have done the same in your query. Check the spellings. Are they [StatA] or are they [Stat A]?
                    Do the same for [StatB] of course.

                    Hi,

                    WHat do you mean by...
                    "missing both of those fields from your query input"

                    Please help..

                    Comment

                    • NeoPa
                      Recognized Expert Moderator MVP
                      • Oct 2006
                      • 32664

                      #11
                      I do TRY to help ;)
                      Your query must be taking its data from somewhere. This can be a single or multiple data sources. In the SQL view of your query you will see this (these) defined in the FROM clause. In the design view you will see it in the Tables area (above the definition of the fields you want the query to return).

                      It may be easier to help you if you posted the SQL string of the query that you are working on. That way we can help you more easily.

                      Comment

                      • ngweixiong
                        New Member
                        • May 2007
                        • 26

                        #12
                        Originally posted by NeoPa
                        I do TRY to help ;)
                        Your query must be taking its data from somewhere. This can be a single or multiple data sources. In the SQL view of your query you will see this (these) defined in the FROM clause. In the design view you will see it in the Tables area (above the definition of the fields you want the query to return).

                        It may be easier to help you if you posted the SQL string of the query that you are working on. That way we can help you more easily.

                        Hi,

                        below is my query codes:

                        Code:
                        SELECT [Average time lead between PO date and Inv Date].[AvgOfTL PO and Inv], IIf([AvgOfTL PO and Inv]<7,[StatA],IIf([AvgOfTL PO and Inv]<10,[StatB])) AS Stat
                        FROM [Average time lead between PO date and Inv Date];
                        Thanks alot

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32664

                          #13
                          I'll have to look at this when I return on Thursday.
                          Please bump the thread if I skip it.

                          Comment

                          • ngweixiong
                            New Member
                            • May 2007
                            • 26

                            #14
                            Originally posted by NeoPa
                            I'll have to look at this when I return on Thursday.
                            Please bump the thread if I skip it.
                            *knock knock*

                            =)

                            kiNdly please help..

                            Comment

                            • NeoPa
                              Recognized Expert Moderator MVP
                              • Oct 2006
                              • 32664

                              #15
                              "Bump" received and understood. I'll do what I can when I can :)

                              Comment

                              Working...