Re: Error 3464 with dCount - some computers only

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



First, a minor correction to my original post. The line producing the error
is actually:
If DCount("*", "qryDocQualityReviewRemind") > 0 Then
[NB: the only change from my original post is the name of the query - I
inadvertently cut/pasted the wrong line from my code.]

The SQL for the query which is producing the error in the dcount statement
is as follows:

SELECT qryDocReview.DocGroup, qryDocReview.ID, qryDocReview.Title,
qryDocReview.Author, qryDocReview.NQRDate, tblDocQRevReminders.Printed
FROM qryDocReview LEFT JOIN tblDocQRevReminders ON (qryDocReview.NQRDate =
tblDocQRevReminders.NQRDate) AND (qryDocReview.ID = tblDocQRevReminders.ID)
WHERE (((tblDocQRevReminders.Printed)=False) AND
((DateAdd("d",-getconst("conDocRevRemind"),[qryDocReview].[NQRDate]))<=Date()))
OR (((tblDocQRevReminders.Printed) Is Null) AND
((DateAdd("d",-getconst("conDocRevRemind"),[qryDocReview].[NQRDate]))<=Date()))
ORDER BY qryDocReview.DocGroup, qryDocReview.ID;

The query itself runs OK on the computer which gives the dcount error.

The line of code I originally posted was:
If DCount("*", "qryDocReviewRemind") > 0 Then
This occurs a little earlier in the same routine, and causes no error. Its
SQL is:

SELECT qryDocReview.DocGroup, qryDocReview.ID, qryDocReview.Title,
qryDocReview.Author, qryDocReview.NRDate AS [Next Review Date],
tblDocReminders.Printed
FROM qryDocReview LEFT JOIN tblDocReminders ON (qryDocReview.ID =
tblDocReminders.ID) AND (qryDocReview.NRDate =
tblDocReminders.NextReviewDate)
WHERE (((tblDocReminders.Printed)=False) AND
((DateAdd("d",-getconst("conDocRevRemind"),[NRDate]))<=Date())) OR
(((tblDocReminders.Printed) Is Null) AND
((DateAdd("d",-getconst("conDocRevRemind"),[NRDate]))<=Date()))
ORDER BY qryDocReview.DocGroup, qryDocReview.ID;

The only difference between these queries is that the one that fails uses a
field NQRDate, and the other uses a field NRDate. Both fields initially
come from linked spreadsheets, and are obtained by qryDocReview (a union
query which combines records from all the spreadsheets) from a series of
select queries which are all of the form:
SELECT "Technical Reports" AS DocGroup, [Technical Reports].ID, [Technical
Reports].Title, [Technical Reports].[Author/Prepared By] AS Author,
IIf(CVDate([Planned Issue Date])>CVDate(nz([Actual Issue
Date],0)),CVDate([Planned Issue Date]),Null) AS NRDate, CVDate([Next Quality
Review Date]) AS NQRDate
FROM [Technical Reports]
WHERE ((([Technical Reports].ID) Is Not Null));

Again, TIA for anything which will help solve this,

Rob

"Jana" <Bauer.Jana@xxxxxxxxx> wrote in message
news:1184015910.278236.97400@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Jul 9, 6:46 am, "Steve" <s...@xxxxxxxxxxxxxxxxxxxx> wrote:
Look at the field(s) in qryDocReviewRemind where there is criteria. Is
the
criteria a date where the field is a number or text? Is the criteria text
where the field is numeric? Is the criteria numeric where the field is
text?

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resou...@xxxxxxxxxxxxxxx

"Rob Parker" <robert.par...@xxxxxxxxxxxxxxxxxxx> wrote in message

news:1183948566.761570.36250@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



The references on both systems appeared to be identical (both
application and version).

Unchecked all (except VBA and MS Access) on the problem computer.
Exited from Access, restarted and re-installed all references
(one .ocx reference was missing, so installed from system32 folder).
Reference lists on both computers again identical.

Problem still exists.

Any other suggestions?

Rob

On Jul 9, 11:45 am, "Steve" <s...@xxxxxxxxxxxxxxxxxxxx> wrote:
Open your application on a computer that you know does not get this
error.
Go to the code window behind one of your forms. Click on Tools -
References
and write down the list of references. Now go to the computer that
sees
this
error and look at the references there. If the list is different in
any
way
make it the same. If the list is the same, uncheck all the references
you
can and then scroll the list and reinstall them.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resou...@xxxxxxxxxxxxxxx

"Rob Parker" <robert.par...@xxxxxxxxxxxxxxxxxxx> wrote in message

news:1183943652.988989.318310@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

A user of one of my applications gets the error message "Run Time
Error 3464 - Data type mismatch in criteria expression" from this
line
of code:
If DCount("*", "qryDocReviewRemind") > 0 Then

The error also arises if I try to print this dcount expression in
the
immediate window, on the user's computer.

The query itself runs fine, and produces a recordset with 36 records
from the current data.

If I run the same database (the same physical file - not a copy of
it)
on my computer, this code (and the print in the immediate window)
works fine.

I'm at a loss here; and a search of the Access newsgroups has not
produced anything of assistance (although it has produced lots of
hits). Any suggestions would be gratefully appreciated.

TIA,

Rob- Hide quoted text -

- Show quoted text -

Rob:

Can you post the SQL for the query qryDocReviewRemind? Perhaps there
is something odd in the underlying query that is messing you up.

Thanks!
Jana



.



Relevant Pages

  • Re: A list of archaeological connections would be nice
    ... They give references. ... big-word stories are lists and lists lists of names and dates ... give proper scholarly references. ... Yes, it's not my fault, and no, ...
    (sci.archaeology)
  • Re: Addnew method/Dynamic Array
    ... stored in a Public Function called GetBatchNumbers() within the current form. ... I created a query detailing all the fields the user needs to see with the ... I'm an aspiring programmer, working in my first IT related ... to qualify the control references with "Me". ...
    (microsoft.public.access.modulesdaovba)
  • Re: VB6: How can I produce a list of Project/References and Project/Components?
    ... all the References *available* on a development box to be of any value ... I've got my lists now, ... Here I am. faced with a virgin disk and a different ... OS and have to start from scratch. ...
    (microsoft.public.vb.general.discussion)
  • Re: Access Crashes When Rt Click Build in Query Design View
    ... And it will happen on more than one query in the database. ... Compact the database to get rid of this junk: ... Choose References from the Tools menu. ...
    (comp.databases.ms-access)
  • Re: I need update query to run from combo box
    ... for someone trying to learn how to do VBA. ... > The query just won't run with the criteria As I said it runs fine when I ... > Microsoft Access 9.0 Object Library ... that implies that you have not set your References ...
    (microsoft.public.access.queries)