'Type Mismatch' error message

D

Doug Sanders

Hi;

In Access '97, I have a form with several check boxes, each referencing a
report. Also there is a check box for a 'Summary' condition.

The form command button 'Run Reports' starts a macro that tests all the
check boxes and then runs the queries needed for all the reports selected.

All the steps appear to work, the reports are displayed, but a message box
pops up everytime giving the 'Type Mismatch'.

The reports are fine, but i don't see where the mismatch can be coming from.

Any ideas or is more info needed?

Thanks,

Doug Sanders
 
S

Steve Schapel

Doug,

This error message would indicate that somewhere along the line, you are
trying to do something with incompatible data types. For example inserting
a text value into a number field.

To solve it, I would say you will just have to poke around in there until
you track it down.

I think the first thing I would try is to put a whole lot of MsgBox actions
in amongst your macro. This will help to isolate which query or report the
error relates to. Once that is done, try to open the query or report
concerned independently, and see if you get the error. Etc.

Please post back with specific details of where you get up to with this
trouble-shoting, if you need more help with it.

--
Steve Schapel, Microsoft Access MVP


Doug Sanders said:
Hi;

In Access '97, I have a form with several check boxes, each referencing a
report. Also there is a check box for a 'Summary' condition.

The form command button 'Run Reports' starts a macro that tests all the
check boxes and then runs the queries needed for all the reports selected.

All the steps appear to work, the reports are displayed, but a message box
pops up everytime giving the 'Type Mismatch'.

The reports are fine, but i don't see where the mismatch can be coming
from.

Any ideas or is more info needed?

Thanks,

Doug Sanders



__________ Information from ESET Smart Security, version of virus signature database 4219 (20090705) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
D

Doug Sanders

Here is what else I have found:

When the macro condition meets certain conditions, it branches to a another
macro such as print report. Then it returns back to check the next
condition test for another report output.

After it checks all eight report requests to see all that are wanted, they
are all displayed or printed, then the error message occurs.

BUT...

If I put the action 'StopAllMacros' after the macro to print let's say the
third report and I select reports 1, 2, and the third, those reports all
run, and there is no error message. But then the rest of the macro is not
run, the other 5 report requests are not tested.

Lastly, if the third report is not requested to be run, the error message
comes back. Reports 1 and 2 are created just before the error message pops
up.


Hope this additional info adds some clarity.

Is there a way to copy the whole macro into a text document so you could see
it?


Thanks,

Doug






Steve Schapel said:
Doug,

This error message would indicate that somewhere along the line, you are
trying to do something with incompatible data types. For example inserting
a text value into a number field.

To solve it, I would say you will just have to poke around in there until
you track it down.

I think the first thing I would try is to put a whole lot of MsgBox actions
in amongst your macro. This will help to isolate which query or report the
error relates to. Once that is done, try to open the query or report
concerned independently, and see if you get the error. Etc.

Please post back with specific details of where you get up to with this
trouble-shoting, if you need more help with it.

--
Steve Schapel, Microsoft Access MVP






__________ Information from ESET Smart Security, version of virus
signature database 4219 (20090705) __________
 
S

Steve Schapel

Doug,

That's the story, you will just have to keep trying these sorts of different
combinations, play like Sherlock Holmes.

So, on the basis of what you have told us so far, would it be valid to
surmise that the problem might be related to report #4? Can you experiment
a bit more with that?

--
Steve Schapel, Microsoft Access MVP


Doug Sanders said:
Here is what else I have found:

When the macro condition meets certain conditions, it branches to a
another
macro such as print report. Then it returns back to check the next
condition test for another report output.

After it checks all eight report requests to see all that are wanted, they
are all displayed or printed, then the error message occurs.

BUT...

If I put the action 'StopAllMacros' after the macro to print let's say the
third report and I select reports 1, 2, and the third, those reports all
run, and there is no error message. But then the rest of the macro is not
run, the other 5 report requests are not tested.

Lastly, if the third report is not requested to be run, the error message
comes back. Reports 1 and 2 are created just before the error message
pops
up.



__________ Information from ESET Smart Security, version of virus signature database 4221 (20090706) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
D

Doug Sanders

I rearranged the order of the reports, deleted report 4 and the same error
occurs. It seems to follow which ever report is last..

BUT..

I ran the 'Save as Visual Basic Module', pointed the 'Run Reports' button
to run the reports, and now

Everything works! Wierd!

I guess I'll have to see what the conversion did and compare it to my
original code.

Thanks for all your interest,

Time for my next challenge.

Doug






Steve Schapel said:
Doug,

That's the story, you will just have to keep trying these sorts of different
combinations, play like Sherlock Holmes.

So, on the basis of what you have told us so far, would it be valid to
surmise that the problem might be related to report #4? Can you experiment
a bit more with that?

--
Steve Schapel, Microsoft Access MVP






__________ Information from ESET Smart Security, version of virus
signature database 4221 (20090706) __________
 

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

Top