notconfident
Programmer
This query works fine with Access 2007 and on 2 other PCs running Access 2010 but not on mine since a bought a new laptop and loaded 2010.
In real time I run the Query from my VBA Code but get the same error if I just try to run the Query direct. This is the error I get :-
Undefined function ‘DCount’ in expression
This is the troublesome Query:-
UPDATE TblIMC SET TblIMC.IMCcount = DCount("Ref_No","Current_Marshal","[BookedIMC] = " & [TblIMC]![IMCid])
WHERE (((TblIMC.IMCdate)>Now()));
When I try to run the Query direct I get the error every time but at normal run time when I get the error as :-
Run-time error '3085':
Undefined function ‘DCount’ in expression
with buttons End Debug Help
Now here is the strange bit.
If I click on 'End' the program runs fine after that until I restart the program.
If I click on 'Debug' it highlights the underlying VBA at DoCmd.OpenQuery "QryIMC_Count" and after closing the Form the error will happen again.
As it appears to only be my Laptop on Access 2010 I compared the References to one of the other PCs that is ok on Access 2010.
They both say the same ?????
There are 6 lines ticked :-
Visual Basic For Applications
Microsoft Access 14.0 Object Library
OLE Automation
Microsoft Visual Basic for Applications Extensibility 5......
Microsoft Office 14.0 Access database engine Objec......
Microsoft Office 14.0 Object Library
If I use ECount instead of DCount all is ok but I dont want to do this as it only appears to be my Laptop that has the issue and am worried that the error could happen elsewhere in the Database.
Sorry for all the typing but I couldnt use copy /paste into this box
Hope someone can help
Thanks
In real time I run the Query from my VBA Code but get the same error if I just try to run the Query direct. This is the error I get :-
Undefined function ‘DCount’ in expression
This is the troublesome Query:-
UPDATE TblIMC SET TblIMC.IMCcount = DCount("Ref_No","Current_Marshal","[BookedIMC] = " & [TblIMC]![IMCid])
WHERE (((TblIMC.IMCdate)>Now()));
When I try to run the Query direct I get the error every time but at normal run time when I get the error as :-
Run-time error '3085':
Undefined function ‘DCount’ in expression
with buttons End Debug Help
Now here is the strange bit.
If I click on 'End' the program runs fine after that until I restart the program.
If I click on 'Debug' it highlights the underlying VBA at DoCmd.OpenQuery "QryIMC_Count" and after closing the Form the error will happen again.
As it appears to only be my Laptop on Access 2010 I compared the References to one of the other PCs that is ok on Access 2010.
They both say the same ?????
There are 6 lines ticked :-
Visual Basic For Applications
Microsoft Access 14.0 Object Library
OLE Automation
Microsoft Visual Basic for Applications Extensibility 5......
Microsoft Office 14.0 Access database engine Objec......
Microsoft Office 14.0 Object Library
If I use ECount instead of DCount all is ok but I dont want to do this as it only appears to be my Laptop that has the issue and am worried that the error could happen elsewhere in the Database.
Sorry for all the typing but I couldnt use copy /paste into this box
Hope someone can help
Thanks