Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function is not available in expressions 1

Status
Not open for further replies.

jerryreeve

Vendor
Jan 16, 2002
2,765
US
I am trying to run an update query where one field is a date field for the last time the "customer" was called.

I can get the query to work fine on my computer where I created the database and query but other computers within the office (identical computers running on XP)are giving me a ....function is not available in expressions in query expression "Date()".... I have tried to refresh the reference and that did not work for me.

I think the difference is that I had a slightly different version of VB6 loaded on my PC at some point in the past. and I suspect that one of the Reference libraries is slightly different between machines.

how can I do one of two possible fixes that might fix this?
1. update the reference library on the other machines to whatever library on my machine is the applicable one. or
2. create a function in the VB module that will return todays date to the query.



----------------------------
'Rule 29', "The enemy of my enemy is my enemy's enemy. No more. No less."
----------------------------
JerryReeve
Communication Systems Int'l
com-sys.com

 
I suspect you've got the problem diagnosed already! When apps run fine on one machine and not on others the first thing you have to think about are missing references.

Here are Doug Steele's instructions on how to troubleshoot the problem:

*** Quote ***

Any time functions that previously worked suddenly don't, the first thing to suspect is a references problem.

This can be caused by differences in either the location or file version of certain files between the machine where the application was developed, and where it's being run (or the file missing completely from the target machine). Such differences are common when new software is installed.

On the machine(s) where it's not working, open any code module (or open the Debug 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)

For far more than you could ever want to know about this problem, check out


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.

**** End Quote ****

Creating a function to return the current date won't work, because to do this, you need to use the Date(), the one that's missing! I believe the library that's missing is named "Visual Basic for Applications." It should be denoted in References on the offending maschines as "Missing."

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
I have seen some other posts with the same problem, and I think it is a vb reference issues, but I do not remember what the fix is.

In these posts the the now() function works and a work around is
int(now()) which returns the date portion of now.
 
Does the database compile properly on the other computer ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
missinglinq: you had it with the "missing" references. thanks.

PHV: the database compiled but I think it might not have since the two IAS libraries were not there.

thanks much, now onward to the next problem.

----------------------------
'Rule 29', "The enemy of my enemy is my enemy's enemy. No more. No less."
----------------------------
JerryReeve
Communication Systems Int'l
com-sys.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top