Type mismatch

Y

Yodaboy

On opening a database I have created, I have an auto exec macro which runs a
report to tell me when I have expired records in my database. This then runs
another macro which if the expired records total more than 1 pings a pop up
message to tell me i have expired records. Howver if there are no expired
records the macro runs and errors with a type mismatch error. Please help the
macro code is

[Reports]![Expiring Records]![Total Expired]>0

i have tried zero's, "", Null and sums that = zero and it still doesnt work.

HELP ME OBI WINDOWS KENOBI YOU ARE MY ONLY HOPE!

Thanks
 
J

Jeff Boyce

Take a look at the Nz() function. I suspect you are trying to compare
something to "nothing there". Your expression might look like:

Nz([Total Expired],0)>0

(but I don't have any idea what your underlying data structure is, and
that's what you'd have to refer to...)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Steve Schapel

Yodaboy,

In addition to Jeff's comments, I am wondering about how you are doing
this. You appear to be trying to read the value of a control on your
report as the Condition for your macro. I would recommend another
approach. I suggest you make a query that returns the expired records.
Forget the report. And you don't need to "open" or "run" the query
when the database opens. Then you can just use this in the Conditiuon
of your macro:
DCount("*","NameOfYourQuery")>0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top