Message box coming up twice

AChir

Registered User.
Local time
Today, 10:52
Joined
Oct 4, 2001
Messages
51
I have a report in which the Detail section has some code in the On Format section. The code checks to see if the value of one field exceeds the value in another and then pops up a message box if it does. I have set it up like this:
If FormatCount = 1 then
If [FirstField] > SecondField
Msgbox "..."
End if
End if

but the message box is still appearing twice for each relevant record when I open the report. Any ideas, please?

Thanks
 
stab in the dark but does the OnFormat run for each control?
 
I'm not sure what you mean there... won't it just run for each record? I'm probably just showing my ignorance there
 
Just pushing this up to ask if anyone has ANY thoughts on this - I have to give a demo of the show-so-far in seven hours and I could do with this working! Many thanks
 
Probably because Access formats the report twice if there's a page count.
 
So why won't the "If FormatCount = 1" route work?

Thank you, Rich - removing the request for the pages being numbered does the trick and will make things look much better in what is now just 3 hours!. I'm greedy and I'd like no double message boxes AND to have numbered pages, so if you have any more thoughts I'd be grateful
 
So why won't the "If FormatCount = 1" route work?

Thank you, Rich - removing the request for the pages being numbered does the trick and will make things look much better in what is now just 3 hours!. I'm greedy and I'd like no double message boxes AND to have numbered pages, so if you have any more thoughts I'd be grateful
 

Users who are viewing this thread

Back
Top Bottom