Trim function not working - MS Access VBA

D

DaviesL

I had the problem whereby from one of my Access queries I would be
calling the Trim function e.g. Trim([Username]). This db and many of
my others had been built using Access pre service pack 3.

We recently upgraded to SP3 and got run time error 7777 saying it
couldn't find the Trim function. I looked at the references and
nothing was missing. But I did manage to fix it:

1) in your VBA script change the Tools-References and OK it
2) try again and it will work (you may think you have chosen the dodgy
reference but read on)
3) put the references back to how they were and OK it
4) try again and it works again

Basically I think the wonder that is MS Access re-validates the
references when they are changed so it untangles all of its pointers
and sorts it out for you.

Hope this helps. Took me ages (and a lot of harassing my tech team)
to figure this out.
 
C

Clif McIrvin

Thanks for sharing the tip.
Basically I think the wonder that is MS Access re-validates the
references when they are changed so it untangles all of its pointers
and sorts it out for you.

From multiple threads I've noticed while lurking in
microsoft.public.access this is a well-known (at least, within the
Access developer community) and much discussed behavior in Access.

--
Clif

DaviesL said:
I had the problem whereby from one of my Access queries I would be
calling the Trim function e.g. Trim([Username]). This db and many of
my others had been built using Access pre service pack 3.

We recently upgraded to SP3 and got run time error 7777 saying it
couldn't find the Trim function. I looked at the references and
nothing was missing. But I did manage to fix it:

1) in your VBA script change the Tools-References and OK it
2) try again and it will work (you may think you have chosen the dodgy
reference but read on)
3) put the references back to how they were and OK it
4) try again and it works again

Basically I think the wonder that is MS Access re-validates the
references when they are changed so it untangles all of its pointers
and sorts it out for you.

Hope this helps. Took me ages (and a lot of harassing my tech team)
to figure this out.
 

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