Main form flickers when opening a pop-up form (1 Viewer)

gojets1721

Registered User.
Local time
Today, 07:37
Joined
Jun 11, 2019
Messages
430
I can't explain the problem, but I found the fix. Make the popup form modal.

1. Personally I hate huge, wide popup forms that take over my whole screen. I find them intrusive and they make me angry as yours did. I moved the form to the second monitor so I could see this webpage but that didn't move the access window and because the form is both popup and Model, I was locked out of the Access window and so had to close the form (at least you didn't remove the x) so I could move the access window to the other screen so I could look at your directions at the same time as the app.
2. The complaints form doesn't need to be that wide.
3. Having two forms bound to the same table open at the same time is the road to disaster. At a minimum, you MUST save the current record BEFORE opening the popup but I would rethink the design.
Hmmm it doesn't seem to work for me. I changed it to modal and it is still flickering...

See attached. Was there anything else you changed?
 

Attachments

  • Example23.accdb
    596 KB · Views: 80

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:37
Joined
Feb 19, 2002
Messages
43,293
Interesting. By the time I got to that point, I had made the mainform a normal form by removing model and popup. since the flicker still happened, it didn't occur to me to go back and redownload the app to go back to ground 0 and just retry the last change.
 

isladogs

MVP / VIP
Local time
Today, 15:37
Joined
Jan 14, 2017
Messages
18,236
I agree with Pat's comments in general but also didn't find making the popup modal helped reduce flicker
Instead I suggest closing the main form when the popup is opened and reopening it when the popup is closed.
Flicker eliminated completely

You would obviously want to return to the same record in the main form which I haven't done
 

Attachments

  • Example24_CR.accdb
    580 KB · Views: 83

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:37
Joined
Feb 19, 2002
Messages
43,293
@isladogs did you also make the mainform normal instead of modal and popup? It may be the combination of doing that and changing the popup to Modal = yes that fixed the flicker for me or maybe it eventually goes away if you open/close the form enough:)

Also, don't close the first form. Just hide it

Me.Visible = False
DoCmd.OpenForm .... '''''' only works for Model forms
Me.Visible = True

Obviously this only works when the form being opened is model because otherwise, the code in the main form doesn't stop so it would just immediately show the original form after opening the modal and not wait for the form to close.
 

isladogs

MVP / VIP
Local time
Today, 15:37
Joined
Jan 14, 2017
Messages
18,236
@isladogs did you also make the mainform normal instead of modal and popup? It may be the combination of doing that and changing the popup to Modal = yes that fixed the flicker for me or maybe it eventually goes away if you open/close the form enough:)

No I didn't ... but I have now - still flickers just as before

Also, don't close the first form. Just hide it

Me.Visible = False
DoCmd.OpenForm .... '''''' only works for Model forms
Me.Visible = True

Obviously this only works when the form being opened is model because otherwise, the code in the main form doesn't stop so it would just immediately show the original form after opening the modal and not wait for the form to close.

Yes I did try that & it works whether or not the popup form is modal ...but in neither case does it prevent the flicker.
Even if you prevent screen repainting, it still flickers

The only way I found to prevent any flickering was what I suggested. Close the main form when opening the popup
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:37
Joined
Feb 19, 2002
Messages
43,293
The only way I found to prevent any flickering was what I suggested. Close the main form when opening the popup
You mean hiding it doesn't work?

I wonder if this is a version issue? I'll check mine when I get home.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:37
Joined
Feb 19, 2002
Messages
43,293
OK, but you might have mentioned the flicker after the reopen. Very strange behavior.
 

isladogs

MVP / VIP
Local time
Today, 15:37
Joined
Jan 14, 2017
Messages
18,236
I thought this made it clear enough:
Yes I did try that & it works whether or not the popup form is modal ...but in neither case does it prevent the flicker.
Even if you prevent screen repainting, it still flickers
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:37
Joined
Feb 19, 2002
Messages
43,293
I guess I should have interpreted "prevent screen painting" with hiding the form. OK. My bad.
 

isladogs

MVP / VIP
Local time
Today, 15:37
Joined
Jan 14, 2017
Messages
18,236
I guess I should have interpreted "prevent screen painting" with hiding the form. OK. My bad.

You asked if I had tried hiding the form and I said I had tried that.
As part of that I also tried 'Preventing screen painting' - I meant exactly that - I tried both Application.Echo False and Screen.Painting=False.
Neither stopped the flicker
 

gojets1721

Registered User.
Local time
Today, 07:37
Joined
Jun 11, 2019
Messages
430
Thanks for the help everyone. I'll probably just keep it the way it is. It's useful to still have the main form open, as you can quickly refer to it without having to exit the pop up form. The flickering is ultimately just a visual nuisance so we can deal with it
 

Users who are viewing this thread

Top Bottom