Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

How to Add 4 Hours to my Default Value?

Discussion in 'Information Technology' started by cw via AccessMonster.com, Jul 28, 2006.

  1. cw via AccessMonster.com

    cw via AccessMonster.com
    Expand Collapse
    Guest

    I have an UnBound Text field on my Form:

    The Format value is set to = mm-dd-yyyy hh:nn am/pm (ex: 07-25-2006 03:00 PM)
    The Default value is set to = Now()

    Question:

    How do I make the Default Value display as: 07-25-2006 07:00 PM
    (The default value should always be 4 hours later?)

    I tried

    =Now() + 04:00

    but get Invalid Syntax

    Thanks
    cw

    --
    Message posted via AccessMonster.com
    http://www.accessmonster.com/Uwe/Forums.aspx/access/200607/1
     
  2. Loading...


  3. Michael H

    Michael H
    Expand Collapse
    Guest

    Hi.

    Try this:
    =DateAdd("h",4,Now())

    -Michael

    "cw via AccessMonster.com" wrote:

    > I have an UnBound Text field on my Form:
    >
    > The Format value is set to = mm-dd-yyyy hh:nn am/pm (ex: 07-25-2006 03:00 PM)
    > The Default value is set to = Now()
    >
    > Question:
    >
    > How do I make the Default Value display as: 07-25-2006 07:00 PM
    > (The default value should always be 4 hours later?)
    >
    > I tried
    >
    > =Now() + 04:00
    >
    > but get Invalid Syntax
    >
    > Thanks
    > cw
    >
    > --
    > Message posted via AccessMonster.com
    > http://www.accessmonster.com/Uwe/Forums.aspx/access/200607/1
    >
     
  4. Tom Wickerath

    Tom Wickerath
    Expand Collapse
    Guest

    Hi CW,

    Use the DateAdd function:

    =DateAdd("h",4,Now())

    http://msdn.microsoft.com/library/d...-us/vbenlr98/html/vafctDateAdd.asp?frame=true


    Tom Wickerath
    Microsoft Access MVP

    http://www.access.qbuilt.com/html/expert_contributors.html
    http://www.access.qbuilt.com/html/search.html
    __________________________________________

    "cw via AccessMonster.com" wrote:

    > I have an UnBound Text field on my Form:
    >
    > The Format value is set to = mm-dd-yyyy hh:nn am/pm (ex: 07-25-2006 03:00 PM)
    > The Default value is set to = Now()
    >
    > Question:
    >
    > How do I make the Default Value display as: 07-25-2006 07:00 PM
    > (The default value should always be 4 hours later?)
    >
    > I tried
    >
    > =Now() + 04:00
    >
    > but get Invalid Syntax
    >
    > Thanks
    > cw
    >
    > --
    > Message posted via AccessMonster.com
    > http://www.accessmonster.com/Uwe/Forums.aspx/access/200607/1
     

Share This Page