Question Newly deployed project didn't recognise TRIM() function

M4RK 1

New member
Local time
Today, 12:00
Joined
Dec 7, 2008
Messages
7
I've just placed a prototype database on a company's server and got a compile error for a line of code which uses the Trim() function. To be honest I don't want to look a fool deploying 'tested' programs which don't work.

This is such a common built-in function so why didn't Access compile it.


I wrote the code in access 2003 and deployed it on the same version. Is there a library reference missing and if so what.

While we're on the subject are there any more problems like this i should expect.

Mark
 
I've just placed a prototype database on a company's server and got a compile error for a line of code which uses the Trim() function. To be honest I don't want to look a fool deploying 'tested' programs which don't work.

This is such a common built-in function so why didn't Access compile it.


I wrote the code in access 2003 and deployed it on the same version. Is there a library reference missing and if so what.

While we're on the subject are there any more problems like this i should expect.

Mark

You did not show the TRIM Command, so I can not reply with a great deal of certanity.
  • TRIM only works with String Type Data. One problem that I have encountered is trying to perform String Functions on Memo Type Variables, so check the Data Type.
If this is not the problem, show the TRIM Statement in Context (the VB Code or the SQL Statement), and we can try to sort it out for you.
 
Thank for your quick reply. The line in question is as follows

s = "*" & Trim(txtSearch) & "*"

It works OK on my machine but raises a compile error on the deployment machine.
 
This is a broken reference, in all likelihood.

I suspect that what happens is, you developed this on your machine. Now you put it up for another user to share on a file server, but ... the version of Access on the user's machine might not have been installed in the same way as the version you have.

References are part of each individual machine's registry, so the fact that your application uses libraries X, Y, and Z hasn't been updated in the registries of those parties who will use the application. Maybe they only use X and Y.

Your fix is to visit the machine having the problem, open Access, open a code window, then from the code window follow path Tools >> References. You can see "broken" references because the dialog/list box will tell you what references it can't find. If you can clear up those references, you are ready to roll.

Search this forum for more about "References" - but be sure to allow your search to include older articles.
 

Users who are viewing this thread

Back
Top Bottom