Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page