Stop form opening and flash

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Stop form opening and flash

Post by agibsonsw »

Hello. Access 2003.
I'm cancelling a form open event, but the form still opens, briefly causing screen-flash.
Is there a way to prevent this?
Thanks, Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
HansV
Administrator
Posts: 78528
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Stop form opening and flash

Post by HansV »

If you cancel opening the form depending on a certain condition, you could test this condition before opening the form, and only open the form if desired:

Code: Select all

If (certain condition) = False Then
  DoCmd.OpenForm "frmTest"
End If
Best wishes,
Hans

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Stop form opening and flash

Post by agibsonsw »

Hello.
That makes sense, but I was just demonstrating the Cancel argument when
someone noticed the screen flash. Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
HansV
Administrator
Posts: 78528
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Stop form opening and flash

Post by HansV »

If you open the form by itself and code in the On Open event sets Cancel = True, I don't think you can suppress the form briefly flashing.
Best wishes,
Hans

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Stop form opening and flash

Post by agibsonsw »

Thought that might be the case. Ta, Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.