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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Missing reference? 4

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
A user gets this error

Function is not available in query expressions 'Val(Right([Barcode],9))'.

Is there a missing reference somewhere. Thanks
 
test the function in the immediate window and see if it works.
?Val(Right("12345",4))

If it does not return 2345 then it could be the reference to vba.
 
Many thanks. Problem is I don't have the program, its with a user, and its an mde version. The mdb version works at my end no problem. User has just aquired a new pc, xp, access 2003, and programs working before are falling over.
 
Do not know what to say, but I have seen where string functions stop working and I had to remove the vba reference and then readd it back in.
 
Thanks again. Looks like I will have to go to the user with an mdb version and debug what I can there. Regards
 
Thanks Bob, if it says whats on the box then that could really be a winner. Thanks very much, have s good weekend.
 
Does the code have to be fired from an autoexec macro, as I tried calling the function from a button on a form after removing one of my references. It gave me the message -
"This application has detected newer versions etc " but seemed to finish quickly, but my reference was not put back? Thanks
 
Yes, it has to fire on the autoexec macro because that is the only thing that fires BEFORE the references are checked by Access.


Bob Larson
A2K,A2K3,A2K7,SQL Server 2000/2005,Crystal Reports 10/XI,VB6, WinXP, and Vista
Free Quick Tutorials and Samples:
 
Thanks Bob. Regards
 
I put both the function and the sub into amodule. I created a macro, calling it autoexec. In the macro I used runcode, and in the function put Checkrefs, however it halts saying it cannot find the name? Whats missing in my brian, thanks
 
Hi Bob, no, it still reports it cannot find the name Checkrefs. I double checked all spelling. My macro is within the macros section of the database. Regards
 
My db works fine, I only tried it in mine to check it out, adding the function and sub seemed relatively simple in a new module, and the macro again seemed straight forward. I have removed it all and guess I will have to visit the user to manually check references/debug. But thanks again for your help.
 
Bob,

That looks like a very handy piece of code - have a star!

Just one (possible silly) question: the code references a qryTestRefs - what is this?

Ed Metcalfe.

Please do not feed the trolls.....
 
Oh yeah - the original code is actually from here:


And it was a test query that was built to test if there was a broken reference. I totally forgot all about that part and also had forgotten where that actually had come from. Sorry for the mixup.


Bob Larson
A2K,A2K3,A2K7,SQL Server 2000/2005,Crystal Reports 10/XI,VB6, WinXP, and Vista
Free Quick Tutorials and Samples:
 
Thanks Bob, much appreciated.

Ed Metcalfe.

Please do not feed the trolls.....
 
Thanks Ed/Bob, I'll have another go.
 
No need to thank me. I haven't offered any assistance with this one. :)

Ed Metcalfe.

Please do not feed the trolls.....
 
Thanks ED, you did do your bit. Thanks Bob, I found where I goofed it, I put Checkrefs in the macro function name instead of Checkrefs(). All works well, thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top