By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,509 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,509 IT Pros & Developers. It's quick & easy.

Problems with commands Date(), Left(), Mid() and Right()

P: n/a
Dear readers,

Is there some one who knows the solution of the problem caused by the
reference libraries in the VBA code. If you run an application on an alien
PC it seems everything is OK. But by running the commands Date() or Left(),
Mid() en Right() an error massage pops up which tells you "unknown command".
But the real problem is the reference library which sows in the VBA | Tools
| Reference form that there is not a missing link but after disconnect the
library and reconnect the library with the next restart everything works
normal also the command Date(), Left(), Mid() and Right().

Is there some on who knows an easy whey to disconnect and reconnect a
library if you start running on an alien PC.

Thanks for any help.

Kind regards,

Simon van Beek
Nov 18 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Simon, you can't really add/remove references programmatically, since the
code depends on the references. As soon as VBA discovers a reference is
missing (any reference, even if the executing code is not using it), you're
shot.

michka has an article explaining this:
How to guarantee that references will work in your applications
at:
http://www.trigeminal.com/usenet/usenet026.asp?1033

Workarounds:
a) Don't use any references you really don't have to.
If you can limit it to the standard 3 only, you're usually safe.
Details of which they are for each version of Access:
http://allenbrowne.com/ser-38.html

b) Use late binding where applicable, so your app is not tied to specific
versions. Details:
http://support.microsoft.com/kb/260410/en-us
http://support.microsoft.com/kb/239930/en-us

c) It would be possible to create a batch file to run regsvr32 to unregsiter
and/or register libraries if that helps you when you change computers.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Simon" <Sv********@Versatel.nlwrote in message
news:45***********************@news.tele2.nl...
Dear readers,

Is there some one who knows the solution of the problem caused by the
reference libraries in the VBA code. If you run an application on an alien
PC it seems everything is OK. But by running the commands Date() or
Left(),
Mid() en Right() an error massage pops up which tells you "unknown
command".
But the real problem is the reference library which sows in the VBA |
Tools
| Reference form that there is not a missing link but after disconnect the
library and reconnect the library with the next restart everything works
normal also the command Date(), Left(), Mid() and Right().

Is there some on who knows an easy whey to disconnect and reconnect a
library if you start running on an alien PC.

Thanks for any help.

Kind regards,

Simon van Beek

Nov 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.