Results 1 to 2 of 2
  1. #1
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402

    dateadd problem

    Hi guys

    I have a form called "Open balance sheet" that when it opens puts start and end dates into unbound text boxes.

    the code i have on the forms on load event is this

    Me.End_Date_Txt_Box = DateSerial(Year(Date), 12, 31)
    Me.Last_Year_Start_Date = DateAdd("yyyy", -1, Me.Start_Date_Txt_Box)
    Me.Last_Year_End_Date = DateAdd("yyyy", -1, Me.End_Date_Txt_Box)
    Me.before_last_start_date = DateAdd("yyyy", -2, Me.Start_Date_Txt_Box)
    Me.before_last_end_date = DateAdd("yyyy", -2, Me.End_Date_Txt_Box)


    Me.last_date = DateAdd("yyyy", -3, Me.Start_Date_Txt_Box)


    when the search button is clicked it opens up a form called "balance sheet" this form sums all the orders and stock in the system between the dates on the open balance sheet form


    This works really well

    what i can't get my head around is this

    what is the code to put onto the balance sheet form that sums all the orders from dates less than equal to the date in the me.last_date text box on the "open balance sheet" form?



    any help would be most welcome.

    Steve

  2. #2
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Juast sorted it

    i have put this into the open balance sheet form for an unbounf textbox called "total stock" and all apears to be working

    =Nz(DSum("[Purchase Total Value]","[Stock levels]","[PurchaseOrder Date] < #" & Format([Forms]![Open Balance Sheet]![Last_date],"mm\/dd\/yyyy") & "#"),0)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Problem with DateAdd
    By Lo-Wang in forum Queries
    Replies: 6
    Last Post: 02-13-2019, 10:55 AM
  2. DateAdd Error
    By TimMoffy in forum Programming
    Replies: 2
    Last Post: 04-17-2013, 10:13 AM
  3. DateAdd()
    By cbrsix in forum Programming
    Replies: 3
    Last Post: 11-22-2011, 02:20 PM
  4. dateadd help
    By dubsdj in forum Queries
    Replies: 3
    Last Post: 03-03-2011, 07:22 PM
  5. Help Please - DateAdd Function
    By graviz in forum Queries
    Replies: 3
    Last Post: 03-02-2010, 02:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums