Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2013
    Posts
    3

    Red face Unanswered: Parameter Value Error

    Hello,

    I have the below formula embedded into an Access form to return a specific date. Recently, this value is causing the database to prompt me for a parameter and subsequently causing my macros/queries to fail. No idea why this is happening.

    =IIf(Weekday(Date())=2,Date()-4,Date()-1)

    Any suggestions?

  2. #2
    Join Date
    Jan 2005
    Posts
    146
    Your code looks good, what does the prompt say?

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    What parameter is it requesting? When is the request appearing?

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    Join Date
    Jul 2013
    Posts
    3
    A popup box to enter a parameter value for this text box. it is the strangest darn thing

  5. #5
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Okay, now where does

    =IIf(Weekday(Date())=2,Date()-4,Date()-1)

    reside...In the Control Source? In the Default Value?

    Wherever it is, you might want to check to be sure that it is still there!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  6. #6
    Join Date
    Jul 2013
    Posts
    3
    It's in the control value. On the form the formula works as required - displaying the correct date. Only when it is queried does it throw the error...

    this is the SQL:

    Code:
    SELECT "Name" AS Category, Count(tbl.[Name #]) AS [#], Sum(tbl.Amount) AS [$] INTO tbl_CurrentStatusCount
    FROM tbl
    WHERE (((tbl.[othername])=No) AND ((([forms]![frm_DateForm]![AsOfDate]-[Date Input])-2)>5) AND ((tbl.Complete)=No))
    GROUP BY "name3";
    the statement ([forms]![frm_DateForm]![AsOfDate] is the function that is causing the parameter box to pop. My date field listed above is named "AsOfDate"

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    this could be a symptom of using reserved words / symbols

    according to Access 2007 reserved words and symbols - Access - Office.com both the hash symbol # and $ are reserved words/symbols and could well be the cause of your problems
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    what is the specific error message reported?
    Code:
     ((([forms]![frm_DateForm]![AsOfDate]-[Date Input])-2)>5)
    I haven't got a clue what you are trying to do with this... how does this limit rows returned.? I don't know what you are expecting from this expression.

    Code:
    ((tbl.Complete)=No))
    is invalid ='No' may be OK

    Code:
    GROUP BY "name3";
    is invalid the value after group by shoudl be a column name not a literal value
    I'd rather be riding on the Tiger 800 or the Norton

  9. #9
    Join Date
    Sep 2006
    Location
    Surrey, UK
    Posts
    995
    Provided Answers: 2
    Are you running the query with the form open?
    10% of magic is knowing something that no-one else does. The rest is misdirection.

Tags for this Thread

Posting Permissions

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