Docmd.openform with/without acDialog strange behavior (1 Viewer)

Wysy

Registered User.
Local time
Today, 12:52
Joined
Jul 5, 2015
Messages
333
Hi, I am struggling with following which more a theoretical question, since some workaround i have found, but still would like to understand the "error".
I have frm1 with pop-up=yes with a cmd button to open frm2 that has pop-up=yes. Frm2 has a subform with fields. After opening frm2 the focus is supposed to be on frm2/subform. The situation is the following:
1. cmd button - docmd.openform "frm2" - frm2 opens without cursor on subform.
2. cmd button - docmd.openform "frm2",,,,,,,acdialog - frm2 opens with cursor on subform first field.

So the workaround is acDialog parameter, but why? The forms are a bit more complicated than this (more controls), but maybe someone has the fast answer since hours i can not figure out why is this.
thank you
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:52
Joined
Oct 29, 2018
Messages
21,553
What other commands do you have in the button after opening frm2?
 

Wysy

Registered User.
Local time
Today, 12:52
Joined
Jul 5, 2015
Messages
333
Before opening i have a close form command for frm1
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:52
Joined
Feb 19, 2002
Messages
43,513
Let me start with - if you don't like the tab layout, you can switch to Overlapping windows. Personally, I hate the tabbed documents view. That may solve the problem about the first form having to be opened as a dialog.

Then, I almost never open more than one form at a time since it just confuses the user. When I do, I open the second form as dialog. That way, they can see the first form but are limited to having focus in the second form and have to finish their business and close the second form before the first form becomes active again.

When you have a form open that is a dialog, opening another form becomes problematic since only the dialog form is supposed to get the focus. That is why you are having trouble opening the third form and so must open it as dialog also.
 

Wysy

Registered User.
Local time
Today, 12:52
Joined
Jul 5, 2015
Messages
333
Thank you so much, now i understand it. So it means since multiple forms are open in dialog mode, it confuses the system so unless it is explicitly "re-commanded", it is not setting the focus to where i think it should.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:52
Joined
Feb 19, 2002
Messages
43,513
Let's go back to --- Are you opening the forms as dialogs BECAUSE you want them to override the tab view?
 

Users who are viewing this thread

Top Bottom