accvbalearner
Registered User.
- Local time
- Today, 17:50
- Joined
- Jan 3, 2013
- Messages
- 42
Hi All,
Thanks in advance for the help everyone here is so great at providing!
My issue today is that I am trying to switch the focus between two forms. One form is the main data entry form for a particular task, the second form is a popup type form for reference only. When a user selects a Work Order # for example a little window will popup giving a few essential details regarding the Work Order selected. I would like for the popup to open but keep the focus on the form that opened the popup.
Initially, I had the popup as a subform and everything was working great, but I ran out of room on the form for users with a lower screen resolution, so I need this form to open up in a separate window, show the data but keep the focus on the main form, this popup also needs to stay open until the record on the main form is complete, then it will close and open again when a new record is started. Data will never be entered into or modified in the popup, its for reference only.
To get the Popup Form to Open I use this code:
DoCmd.OpenForm "frmName2", , , fmCap3, acFormReadOnly
I have tried the following code in OnLoad, OnGotFocus and OnOpen Events for the Popup Form and none are working, :
I have substituted frmName and frmControlName for the actuals used in the Popup Form.
Example 1
With Forms(frmName)
.SetFocus
.Controls([frmControlName]).SetFocus
End With
Example 2
Forms!(frmName).Form.frmControlName.Setfocus
Example 3
Me.frmName.Form.frmControlName.SetFocus
Example 4
Forms.frmName.Form.frmControlName.Setfocus
Take Care,
accvbalearner
Thanks in advance for the help everyone here is so great at providing!
My issue today is that I am trying to switch the focus between two forms. One form is the main data entry form for a particular task, the second form is a popup type form for reference only. When a user selects a Work Order # for example a little window will popup giving a few essential details regarding the Work Order selected. I would like for the popup to open but keep the focus on the form that opened the popup.
Initially, I had the popup as a subform and everything was working great, but I ran out of room on the form for users with a lower screen resolution, so I need this form to open up in a separate window, show the data but keep the focus on the main form, this popup also needs to stay open until the record on the main form is complete, then it will close and open again when a new record is started. Data will never be entered into or modified in the popup, its for reference only.
To get the Popup Form to Open I use this code:
DoCmd.OpenForm "frmName2", , , fmCap3, acFormReadOnly
I have tried the following code in OnLoad, OnGotFocus and OnOpen Events for the Popup Form and none are working, :
I have substituted frmName and frmControlName for the actuals used in the Popup Form.
Example 1
With Forms(frmName)
.SetFocus
.Controls([frmControlName]).SetFocus
End With
Example 2
Forms!(frmName).Form.frmControlName.Setfocus
Example 3
Me.frmName.Form.frmControlName.SetFocus
Example 4
Forms.frmName.Form.frmControlName.Setfocus
Take Care,
accvbalearner