InterviewStart (format= "mm/dd/yyyy HH:mm")
InterviewEnd (format= "mm/dd/yyyy HH:mm")
When the user inserts a record, the InterviewStart field updates to Now().
I would like to set the default value of InterviewEnd to be 1.5 hours from
Now(). How does the VBA code look in order to accomplish this?
TIA!
You might try something like:
Me.InterviewEnd = DateAdd("h", 1.5, Now())
or
Me.InterviewEnd = DateAdd("h", 1.5, Me.InterviewStart
Hope that helps...
I think you'll need to use:
Me!InterviewEnd = DateAdd("n", 90, Me!InterviewStart)
The increment argument to DateAdd needs to be an integer so you can add 90
minutes but not 1.5 hours.
--
John W. Vinson [MVP]
Correct would be --
InterviewStart (format= "mm/dd/yyyy HH:nn")
InterviewEnd (format= "mm/dd/yyyy HH:nn")
--
Build a little, test a little.
"John W. Vinson" wrote:
> .
>
--
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000/2003
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201001/1
>>InterviewStart (format= "mm/dd/yyyy HH:mm")
>>InterviewEnd (format= "mm/dd/yyyy HH:mm")
>This is wrong as "m" is used for Months and not Minutes.
To my moderate surprise, the Format feature is sufficiently context-sensitive
that it interprets the first mm as month and the second as minutes:
?format(now,"mm/dd/yyyy hh:mm")
01/07/2010 16:34
I'd still use n for miNutes and m for Months, though!
"John W. Vinson" wrote:
> .
>
I remember a very confusing afternoon trying to figure out why my DateAdd
wasn't working. IIRC I asked a question here and someone pointed me the right
direction.