Time from server

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Have tried to use Dev Ashish's code to no avail. Where am I going wrong,
where do you place the code on the forms?
Cheers Ross
 
I assume you're speaking of the code listed at
http://www.mvps.org/access/api/api0039.htm.

The code should be placed in a standard module that you create in the
Modules tab of the database window. The module should be given a unique name
when you save it (i.e. not the name of any of the procedures it contains or
the name of any procedure in any other module).

In your form, you would call the Public Function, fGetServerTime, listed in
the code. You would call it with syntax similar to this:

dteTime = fGetServerTime(\\ServerName)

Be aware, as it stated on the page, this will NOT work on a Win9x computer.
It will only work on an NT computer (NT4, Win2k, WinXP, Win2003 Server).
 
Hi Wayne
Your on the right track - have created the module and named it
MRLogisticsTimeServ
Have tried to call it from the page with

Private Sub Form_Open(Cancel As Integer)

Me.txttime = fGetServerTime(\\Nt_0485)

End Sub

Get Compile Error highlighting the first \

Any ideas?

Cheers Ross
 
The name needs to be passed as a string, try

Me.txttime = fGetServerTime("\\Nt_0485")
 
Cheers Wayne - works a treat,
Owe you one!

Wayne Morgan said:
The name needs to be passed as a string, try

Me.txttime = fGetServerTime("\\Nt_0485")
 
This code works for me only if it is after 12 o'clock noon. When it's 9:30
AM it reports -03:30:00 PM. As soon as it's 12:01 PM it works fine. Does
anyone have an idea why that is?

-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top