Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Changing Time using a macro
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Waitsu  
View profile  
 More options Nov 4, 8:53 pm
Newsgroups: microsoft.public.access
From: Waitsu <Wai...@discussions.microsoft.com>
Date: Wed, 4 Nov 2009 01:53:01 -0800
Local: Wed, Nov 4 2009 8:53 pm
Subject: Changing Time using a macro
I have a form where you enter in a time in HH:MM format and displays it in
military time.

I want to be able to add or subtract a specific number of hours from that
time and save it in a different field on the same form.

I tried using the following =DateAdd("h",-1,[fielda]) in the macro under the
set value option but I get an error.

I can get this to work if I create another field called fielda-date and set
the control source to =dateAdd("h",-1,[fielda-date]) then use the macro to
set the value of fielda to fielda-date - but that is the long way.

Is there a way to do this without having to go through the alternate process?


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mr. B  
View profile  
 More options Nov 4, 11:48 pm
Newsgroups: microsoft.public.access
From: Mr. B <dracc...@askdoctoraccess.com.nospamallowed>
Date: Wed, 4 Nov 2009 04:48:01 -0800
Local: Wed, Nov 4 2009 11:48 pm
Subject: RE: Changing Time using a macro
Waitsu,

You are using the correct function but it would appear that you are
attempting to use the "field name" as opposed to the "Name of the control"
that has the date you want to use in your calculation.

=DateAdd("h",-1,[NameOfControl])

-----
HTH
Mr. B
http://www.askdoctoraccess.com/
Doctor Access Downloads Page:
http://www.askdoctoraccess.com/DownloadPage.htm


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google