+ Reply to Thread
Results 1 to 4 of 4

Thread: Populate Date field (CurrentDate + 30) in table if blank

  1. #1
    Barn Newbie chrisjack001 is an unknown quantity at this point chrisjack001's Avatar
    Join Date
    Aug 2010
    Posts
    18
    Rep Power
    2

    Populate Date field (CurrentDate + 30) in table if blank

    I have a "Print" button on a Form called "Invoices" that that has embedded macros on the click event I want to replace with VB code due to the limitation in Macro. Currently this Macro does the following

    1. Opens and runs a query called "SubtotalUpdate"
    2. Opens and runs a query called "InvoiceTotalAppend"
    3. Opens and populates a Report called "Invoices" with the DueDate from "Invoices" table before printing.
    This is what I want to add to the existing macro all converted to VB code
    4. If the DueDate field is blank in the "Invoices" table I want the date saved in that blank field in the table as (Current date + 30 days) before executing option 3. The format of the date should be mm/dd/yyyy. Can I replace this macro with a VB code. Can you please help with the code on Click event. Thanks

  2. #2
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Moved to Microsoft Access...I'm assuming it's an Access Database.

  3. #3
    Barn Newbie chrisjack001 is an unknown quantity at this point chrisjack001's Avatar
    Join Date
    Aug 2010
    Posts
    18
    Rep Power
    2

    Yes this is an Access database

  4. #4
    Barn Newbie HiTechCoach will become famous soon enough HiTechCoach's Avatar
    Join Date
    May 2010
    Posts
    26
    Rep Power
    2

    Quote Originally Posted by chrisjack001 View Post
    I have a "Print" button on a Form called "Invoices" that that has embedded macros on the click event I want to replace with VB code due to the limitation in Macro. Currently this Macro does the following

    1. Opens and runs a query called "SubtotalUpdate"
    2. Opens and runs a query called "InvoiceTotalAppend"
    3. Opens and populates a Report called "Invoices" with the DueDate from "Invoices" table before printing.
    This is what I want to add to the existing macro all converted to VB code
    4. If the DueDate field is blank in the "Invoices" table I want the date saved in that blank field in the table as (Current date + 30 days) before executing option 3. The format of the date should be mm/dd/yyyy. Can I replace this macro with a VB code. Can you please help with the code on Click event. Thanks
    It the field has the data type of data/time then you do can just use =Date() + 30. You do not want to format it as it is saved. You format it when you display the data. The advantage to stofing using the date/time data type is the it is stored as a date serial number that is not formated. This allows you to cahnge the display format as needed.

    Can you use an update query to set the data?

    It would help to have more details about the table structures.

+ Reply to Thread

Similar Threads

  1. Compare user entered date to date in table
    By tuxalot in forum Microsoft Access
    Replies: 1
    Last Post: February 27th, 2009, 10:31 AM
  2. Need to update table field every day
    By micky in forum .NET Development
    Replies: 16
    Last Post: January 13th, 2009, 07:43 AM
  3. IIF Query to fill in a blank field on a report
    By Dwaffler in forum Microsoft Access
    Replies: 3
    Last Post: September 24th, 2008, 09:28 PM
  4. How to retrieve unknown recordset field names in table?
    By BLaaaaaaaaaarche in forum ASP Development
    Replies: 2
    Last Post: August 10th, 2008, 09:33 AM

Bookmarks

Posting Permissions

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

SEO by vBSEO