Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Access (https://www.askmehelpdesk.com/forumdisplay.php?f=441)
-   -   Invalid date value in expression builder (https://www.askmehelpdesk.com/showthread.php?t=391417)

  • Aug 28, 2009, 01:32 PM
    JoeMicro
    Invalid date value in expression builder
    Hi,

    I want to sum a column on an unbound subform based on a txtbox on the main form, so I entered this
    Code:

    Sum(IIf([CheckDate]>=[Forms]![frmStatements]![txtDate] ,[Quantity],0))
    in a textbox on the subform but I get #Error in the txtbox.

    So I tried adding # so I get an error "the expression you entered has an invalid date value"?

    Any help would be appreciated.

    Joe
  • Aug 28, 2009, 03:03 PM
    ScottGem
    Try this as the ControlSource of the textbox:

    Code:

    =DSum("[Quantity]","tablename","[CheckDate] > #" &
    Forms]![frmStatements]![txtDate] & "#")

  • Aug 29, 2009, 09:54 PM
    JoeMicro
    Thanks Scott,

    I tried u'r solutions I changed "tablename" to my table name (and that's all I did) and I get the message "The expression you entered contains invalid syntax"

    The reason why I don't want to use "Dfunctions" is because its not being constantly updated as records are being entered in the subform unlike the sum iif function.

    Any other suggestions you could think of?

    Thank you again
    Joe.
  • Sep 9, 2009, 07:11 PM
    JoeMicro
    Any ideas anybody?

  • All times are GMT -7. The time now is 12:23 AM.