DSum local variable as criteria

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmoudy77
    New Member
    • Sep 2007
    • 20

    DSum local variable as criteria

    Hi,

    I'm trying to use a variable "FirstSemi" as the second criteria in a DSum function. The DSum function is used in the same Form_Load function that the variable was declared. I keep getting an error referencing the variable in the DSum function when the form loads. Any ideas?

    And [FltDate] > FirstSemi")

    -Josh
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Originally posted by jmoudy77
    Hi,

    I'm trying to use a variable "FirstSemi" as the second criteria in a DSum function. The DSum function is used in the same Form_Load function that the variable was declared. I keep getting an error referencing the variable in the DSum function when the form loads. Any ideas?

    And [FltDate] > FirstSemi")

    -Josh
    Hi. It would be better to see the whole DSUM statement, not just the last part of it. Change the And to
    [code=vb]And [FltDate] > #" & FirstSemi & "#")[/code]

    -Stewart

    Comment

    • jmoudy77
      New Member
      • Sep 2007
      • 20

      #3
      Thanks Stewart, worked like a charm.

      -Josh

      Comment

      Working...