Undefined Function Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use the following expression in a query and get a "Undefined
function 'CInt' in expression" error. If I take off the "CInt" part, I then
get an undefined function error for the "DLookUp." I have used this exact
function in another DB with no problem. Any ideas what is happeining here? Is
there something that needs to be set DB specific?

TIA.

MaxCount: CInt(DLookUp("[FirstCount]","[tblFirstPP]","[FirstPP]=" &
DMax("[PP]","[tblMaster]")))
 
If any of the database's references are messed up -- you can get that
prompt.

Try following these steps (from a post by Douglas Steele, MVP):

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
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html
 
I am trying to use the following expression in a query and get a "Undefined
function 'CInt' in expression" error. If I take off the "CInt" part, I then
get an undefined function error for the "DLookUp." I have used this exact
function in another DB with no problem. Any ideas what is happeining here? Is
there something that needs to be set DB specific?

TIA.

MaxCount: CInt(DLookUp("[FirstCount]","[tblFirstPP]","[FirstPP]=" &
DMax("[PP]","[tblMaster]")))

Your PC has a missing reference.
Open any module in Design view (or click Ctrl + G).
On the Tools menu, click References.
Click to clear the check box for the type library or object library
marked as "Missing:."

An alternative to removing the reference is to restore the referenced
file to the path specified in the References dialog box. If the
referenced file is in a new location, clear the "Missing:" reference
and create a new reference to the file in its new folder.

See Microsoft KnowledgeBase articles:
283115 'ACC2002: References That You Must Set When You Work with
Microsoft Access'
Or for Access 97:
175484 'References to Set When Working With Microsoft Access' for
the correct ones needed,
and
160870 'VBA Functions Break in Database with Missing References' for
how to reset a missing one.

For even more information, see
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html
 
You might try adding the SUM function:

MaxCount: Sum(CInt(DLookUp("[FirstCount]","[tblFirstPP]","[FirstPP]=" &
DMax("[PP]","[tblMaster]"))))

Your expression assumes that PP is numeric.

Debbie

|I am trying to use the following expression in a query and get a "Undefined
| function 'CInt' in expression" error. If I take off the "CInt" part, I then
| get an undefined function error for the "DLookUp." I have used this exact
| function in another DB with no problem. Any ideas what is happeining here? Is
| there something that needs to be set DB specific?
|
| TIA.
|
| MaxCount: CInt(DLookUp("[FirstCount]","[tblFirstPP]","[FirstPP]=" &
| DMax("[PP]","[tblMaster]")))
 
Well, this is over my head. If I use Alt-F11, I can see three modules that I
had tried to import from another DB. When I double click on a module to open
it, I get a VB error: "Error accessing file. Network connection may have
been lost."

I get the same error if I try to delete a module. This must be related to my
other probelm but I can't figure out how or what to do about it.

If I create a brand new DB and try to import objects from this DB, some come
in fine. Those that have event procedures attached give the following error:
"Name conflicts with existing module, project, or object library." Then the
object does inport, but I can not see the code behind the procedure. If I try
to view the code nothing happens and when I clode the object, I get a MS.EXE
error and the application closes.

If you have no suggestions, I understand. This thing is driving me crazy.
 
In case anyone is still "listening", the probelm was that I had 2000 and 2003
installed on my machine. I didn't know that 2003 brought in some DLL's that
can cause havoc if you try to use 2000.
 
Just so you know, it's not strictly a problem between Access 2000 and Access
2003. Installing any new software can cause problems like this.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ken said:
In case anyone is still "listening", the probelm was that I had 2000 and
2003
installed on my machine. I didn't know that 2003 brought in some DLL's
that
can cause havoc if you try to use 2000.

Ken said:
I am trying to use the following expression in a query and get a
"Undefined
function 'CInt' in expression" error. If I take off the "CInt" part, I
then
get an undefined function error for the "DLookUp." I have used this exact
function in another DB with no problem. Any ideas what is happeining
here? Is
there something that needs to be set DB specific?

TIA.

MaxCount: CInt(DLookUp("[FirstCount]","[tblFirstPP]","[FirstPP]=" &
DMax("[PP]","[tblMaster]")))
 
Back
Top