Type Mismatch

tjcinnamon

Registered User.
Local time
Today, 17:03
Joined
Jan 26, 2006
Messages
66
I have a report that shows you a sum of the expenses for all of our jobs =Sum([TotalReported]).

On a form prior to opening this report we have totals that we have to report to the state =[Forms]![MonthlyFinancialQueriesForm]![Total Checker].

I then have a Variance text box [Total Difference] which I have conditionally formatted to turn Yellow when this =[Forms]![MonthlyFinancialQueriesForm]![Total Checker]-Sum([TotalReported]) <> 0.

Everything works to this point.

I am creating a Macro that turns the Visiblilty of the [Total Checker] and [Total Difference] to No using SetValue().

Then I set a condition in the macro for (Total Difference]<>0) to SetValue [Total Checker].[Visible] Yes.

No matter what its visibility is set to NO. I also get a type mismatch error which I think is where the problem resides. I checked all the values involved to make sure that they are number values and as far as I can tell they are.

Any suggestions are way appreciated,
Thanks,
JOe K.
 
One broken keyboard, 2 anger managment classes and numerous career re-evaluations later, I figured it out. The sum([TotalReported]) was figured out after the creation of the report, therefore having the macro run On Open of the report was creating the error because sum wasn't created yet. I had to have it run the macro On Activate which runs it immediatly after. Everything is well.

Thanks for all of your help on other problems previous to this,
HAVE A GREAT WEEKEND!!!!
JOe K.
 
tjcinnamon said:
One broken keyboard, 2 anger managment classes and numerous career re-evaluations later, I figured it out.

ROTFL!!!! Thanks for this little comment! It made my day!
 

Users who are viewing this thread

Back
Top Bottom