Complile error when using date & Time

D

Don Ireland

I have an application that I developed in Access. It looks at the system
date and time for certain events. On some computers it works and on others
it doesn't. I can only assume that there is something that needs to be
registered somewhere to make the other machines functional.

The code the causes the error was a simple set a text box to the date:
TxtDate.Value = Date
I also created a box to display the current time....
TxtTimer.Value = Time

Both lines are in a Form's Load event. Both lines failed only on certain
PC's. Any idea what I am missing????
 
J

Jeff Boyce

Don

Sounds like one/more of the references on "those" machines are flagged as
MISSING by Access.

On one of the offending PCs, open a code module, click Tools | References.

See if any of the checked References are prefixed with "MISSING". Make note
of which ones.

Uncheck those prefixed as MISSING. Click OK/Save/(whatever) to accept the
changes.

Re-open the References (see above). Re-check the References formerly
considered MISSING by Access. Click OK/Save/....

Click Debug | Compile xxxxx (first on the list).

If the References were "found", your code should recompile (assuming it
compiled before!).

Regards

Jeff Boyce
<Office/Access MVP>
 
D

Don Ireland

Jeff,

That is what I thought... I checked the references on 2 of the machines. I
didn't think to uncheck and then re-check. I registered a couple libraries
with regsrv32 and the "missing" went away on both machines. However, the
code still only worked on one machine. Now I am stumped.....

If nothing shows up missing in the references, what else could there be????
 
J

Jeff Boyce

"The code failed ..."

What happened? What error message did you get?

Jeff Boyce
<Office/Access MVP>
 
D

Don Ireland

I received a "Compile Error". There was another line after that one. I'll
see if I can duplicate it.

It highlighted the lines where I tried to use Time and Date. Like I said
though, it only failed on certain machines.......

Any ideas????
Don
 
D

Don Ireland

Jeff,

I went through the PC's that can run the application. I received the
Compile Error - Can't find project or library error. I looked at the
references and found 2 that, when I looked further at them, looked like they
had nothing to do with access or visual basic. (One was for Autocad and the
other was media player). I uncheck the reference box and re-ran the code.
It worked great. I checked a few other pc's and got the same thing.

Do you know if there is a dependence on other applications (like media
player) for simple things like date and time? If so, are there others I need
to watch for?
 
J

Jeff Boyce

Don

I've not ever run across a media player interaction with Date/Time
data/functions. Perhaps you just got "lucky"?!

Regards

Jeff Boyce
<Office/Access MVP>
 

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

Top