Increment a text box date automatically

Posted on 2011-05-09
Last Modified: 2012-05-11
In a form I have a command button that executes an append query. After the append query has executed I would like to automatically add a day to an unbound text box that contains a date. I thought adding code to the event that executes the append query would be appropriate. What code would I add? Thanks.
Question by:StampIT
    LVL 12

    Accepted Solution

    Use the DateAdd() function;

    for example DateAdd("d",1,[YourDateField])


    Author Closing Comment

    Thank you, Daniel.
    LVL 16

    Expert Comment

    danishhani's response is correct under normal circumstances but in this instance there may be some problem.

    If the textbox is unbounded then I presume that it will not contain any value so there is not value to purform the dateadd function on.

    Author Comment

    The unbound textbox does have a default value when the form opens which the user can change. There should always be a value. Thanks for the comment.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now