467,116 Members | 1,255 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,116 developers. It's quick & easy.

VBA to open control panel's "Internet Date & Time" applet

MLH
Would like to run the control panel's
Internet Date & Time program from VBA
- emulating opening it, clicking the Internet
Time tab and the Update Now button.

I don't really care for the user to see all
this. Would just like to sync the system
time with the facility built-in to XP and
automatically w/o asking the user to go
through the steps manually.

Ideas?
Sep 19 '06 #1
  • viewed: 4785
Share:
13 Replies

MLH wrote:
Would like to run the control panel's
Internet Date & Time program from VBA
- emulating opening it, clicking the Internet
Time tab and the Update Now button.

I don't really care for the user to see all
this. Would just like to sync the system
time with the facility built-in to XP and
automatically w/o asking the user to go
through the steps manually.

Ideas?
IMO, this is a _bad_ thing to do. I would be wondering what kinds of
things someone had been doing to my computer if code in an app did this
to me. I'd like it about as much as I like lookup fields. PITA and
you can't tell how they're really working. I would advise against it
unless it's an absolutely critical feature and it's your last resort.

Any files the user changes while you have the settings monkeyed about
will not be found with a search for files within a date range.

So what are you _really_ trying to accomplish? Getting a timestamp
from another time zone? Did you look on Randy Birch's site and on
AccessWeb? (Or here... MGFoster posted something that looked
promising).

there you have it, my 2 cents...

Pieter

Sep 19 '06 #2
MLH
>IMO, this is a _bad_ thing to do. I would be wondering what kinds of
things someone had been doing to my computer if code in an app did this
to me. I'd like it about as much as I like lookup fields. PITA and
you can't tell how they're really working. I would advise against it
unless it's an absolutely critical feature and it's your last resort.

Any files the user changes while you have the settings monkeyed about
will not be found with a search for files within a date range.

So what are you _really_ trying to accomplish? Getting a timestamp
from another time zone? Did you look on Randy Birch's site and on
AccessWeb? (Or here... MGFoster posted something that looked
promising).

there you have it, my 2 cents...

Pieter
Pieter - I see your point. The app is running on dedicated
windows PC used for little else. Multi-user access to the
PC is provided so all users needing the app can run it. Sync'ing
the server's timeclock to current internet isn't going to bother
anyone in particular.

Sep 19 '06 #3
Did you look here?:

http://vbnet.mvps.org/code/network/netremotetodsync.htm

Usually when I can't find an answer to something, I do something like
this:
1. check the NGs.
2. check AccessWeb for Access-specific stuff
3. check VBNet for non-Access VB stuff or more general VB stuff that I
can call in Access.

Then I don't have to wait around for people to answer... I'm just
really impatient and stubborn.

Sep 19 '06 #4
MLH
On 19 Sep 2006 14:41:41 -0700, pi********@hotmail.com wrote:
>Did you look here?:

http://vbnet.mvps.org/code/network/netremotetodsync.htm
>Then I don't have to wait around for people to answer... I'm just
really impatient and stubborn.
I appreciate the link. I get an error saying I must be on the control
in order to set a property of the control when the 6th line in this
snippet from the site runs...

Private Sub Command1_Click()
DoCmd.GoToControl ("Text1")
Text1.Text = Now
'Text2 is set in SynchronizeTOD function
DoCmd.GoToControl ("Text3")
Text3.Text = SynchronizeTOD("laptop2000")
End Sub

Obviously, I need to substitute something else in
the line to replace "laptop2000" - I'm unsure what
to put there. I was hoping to sync to an internet
time server.
Sep 19 '06 #5
MLH
Oops...
I finally saw the link I think you intended for me to visit...
http://vbnet.mvps.org/index.html?cod...otetodsync.htm
The code there looks much more promising. I do have a question though,
when I try to insert the Microsoft Winsock 6 control, a message saying
I don't have the license required to use the ActiveX control pops. It
complains that I tried to create the unlicensed ActiveX control and
that I must contact the company that provides the licensed OLEobject
or ActiveX control. I'm lost in that regard.
Sep 19 '06 #6
pi********@hotmail.com wrote in
news:11**********************@h48g2000cwc.googlegr oups.com:
Did you look here?:

http://vbnet.mvps.org/code/network/netremotetodsync.htm
We discussed to death the subject of synchronizing with time servers
several months ago, in a discussion initiated by MLH.

Alzheimer's, perhaps?

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Sep 19 '06 #7
Would just like to sync the system
time with the facility built-in to XP and
automatically w/o asking the user to go
through the steps manually.
The NET TIME command supports switches to accomplish this.

MLH wrote:
Would like to run the control panel's
Internet Date & Time program from VBA
- emulating opening it, clicking the Internet
Time tab and the Update Now button.

I don't really care for the user to see all
this. Would just like to sync the system
time with the facility built-in to XP and
automatically w/o asking the user to go
through the steps manually.

Ideas?
Sep 20 '06 #8
It's fascinating that on September 14 that you can post to a thread
begun on September 19.

Maybe there's great opportunity here! I could do a search for the first
reference to some procedure, say "SaveAsText" and then introduce
"SaveAsText" with a post in some likely thread dated a few days
earlier.

Presto! I am the first and original "SaveAsText" guru!!! Just do a
Google Search and you'll see!

ROFL!

Sep 20 '06 #9
MLH wrote:
Would like to run the control panel's
Internet Date & Time program from VBA
- emulating opening it, clicking the Internet
Time tab and the Update Now button.

I don't really care for the user to see all
this. Would just like to sync the system
time with the facility built-in to XP and
automatically w/o asking the user to go
through the steps manually.

Ideas?
try

Public Sub SetTime()
' should work from win 95/IE 4.0 inclusive onwards
Dim s32 As Object
Set s32 = CreateObject("Shell.Application")
s32.SetTime
' I doubt if this next line is required
Set s32 = Nothing
End Sub

Sep 20 '06 #10
To whom are you responding, Lyle? All the posts in this thread, in my OE
list, are dated September 19.
"Lyle Fairfield" <ly***********@aim.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
It's fascinating that on September 14 that you can post to a thread
begun on September 19.

Maybe there's great opportunity here! I could do a search for the first
reference to some procedure, say "SaveAsText" and then introduce
"SaveAsText" with a post in some likely thread dated a few days
earlier.

Presto! I am the first and original "SaveAsText" guru!!! Just do a
Google Search and you'll see!

ROFL!

Sep 20 '06 #11
"Larry Linson" <bo*****@localhost.notwrote in
news:KghQg.614$zh.528@trnddc08:
To whom are you responding, Lyle? All the posts in this thread, in my
OE list, are dated September 19.
Check this thread on Google.
>
"Lyle Fairfield" <ly***********@aim.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>It's fascinating that on September 14 that you can post to a thread
begun on September 19.

Maybe there's great opportunity here! I could do a search for the
first reference to some procedure, say "SaveAsText" and then
introduce "SaveAsText" with a post in some likely thread dated a few
days earlier.

Presto! I am the first and original "SaveAsText" guru!!! Just do a
Google Search and you'll see!

ROFL!
--
Lyle Fairfield
Sep 20 '06 #12
Larry Linson wrote:
To whom are you responding, Lyle? All the posts in this thread, in my OE
list, are dated September 19.
MLH is having a bad week. He posted with a date of 14 Sept though his
header shows an nntp POST DATE OF Tue, 19 Sep 2006 17:36:48 -0500. I'm
sure he must have been testing with his computer clock, given the
subject, and forgot to reset it properly! 8)

<hint to MLHMy experience is that when people are continually getting
angry annd frustrated with me it's time to take a breather.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Sep 20 '06 #13
MLH
I meant to tell you I appreciated the advice as well.

For (1), you mean this NG. Are there other's you would recommend? How
does microsoft.public.access.formscoding rate?
For (2), is that www.mvps.org/access/ ?
For (3), VBNet is vbnet.mvps.org/

Thx again.
Sep 23 '06 #14

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by barney | last post: by
5 posts views Thread by martin | last post: by
3 posts views Thread by DC Gringo | last post: by
2 posts views Thread by Mehdi | last post: by
14 posts views Thread by Arne | last post: by
7 posts views Thread by Kirt | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.