UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> String functions don't work in queries    
 
   
curtswanson
post Jul 6 2005, 12:24 PM
Post #1

UtterAccess Enthusiast
Posts: 66



I use functions such as mid, left, right, format, etc. in Access Queries but occasionally they stop working. For instance, if I define a query column as

FirstLetter: Left([my field name],1)

When I run the query I get an error message box that states "Compile error in query expression 'Left([my field name],1)'."

The functions work correctly in modules but not in queries. These queries can work for months and then suddenly they stop. I look at the object browser in a vba module and these functions are part of the VBA reference file which is automatically installed as a reference. I have tried things before like adding references to Excel 8.0 (this often works whereas Excel 11.0 doesn't!) but this is not working this time. Sometimes I must remove the reference and then re-add it but that didn't work this time either.

Any help will be greatly appreciated.
Go to the top of the page
 
+
freakazeud
post Jul 6 2005, 12:33 PM
Post #2

UtterAccess VIP
Posts: 31,413
From: NC, USA



Hi,
check this:
you may receive...
HTH
Good luck

P.S. you might need to fix broken references. This is Doug Steele's instructions for how to do it:
QUOTE
Open any code module (or open the Immediate Window, using Ctrl-G, provided
you haven't selected the "keep debug window on top" option). Select Tools |
References from the menu bar. Examine all of the selected references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in).

Just so you know: the problem will occur even if the library that contains
the specific function that's failing doesn't have a problem.


Edited by: freakazeud on Wed Jul 6 13:36:31 EDT 2005.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 24th May 2013 - 03:24 AM