Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Focus Multiple Pop up Forms 1

Status
Not open for further replies.

keiem

Technical User
Aug 1, 2001
27
US
I have three forms.

1. frmEventData
2. frmAddEventData (set as pop up)
3. frmAddPersonalData (set as pop up)

A button on frmEventData opens frmAddEventData as a pop up in which new event data can be added. From the frmAddEventData there is another button that opens frmAddPersonalData as a pop up, to add new personal data.

Both frmEventData and frmAddEventData have subforms.

My goal is to populate frmAddEventData with new data entered into frmAddPersonalData after the latter is closed. I would like to likewise populate frmEventData after frmAddEventData is closed.

I already understand how to 'refresh' a form/subform in order to populate the forms with my new data.

My problem is this:
Whenever I close frmAddPersonalData the focus returns to frmEventData (even when it is invisible or minimized) instead of frmAddEventData, which is where I would like the focus to be set.

In addition to not putting the focus on the form I would like, any refresh command I try to execute in the close button of frmAddPersonalData only refreshes/populates data in frmEventData, which ends up having the focus.

Assuming all this makes any sense, does anyone have suggestions on how to either

1. Set the focus to frmAddEventData (the first open pop up) on the close of frmAddPersonalData (the second open pop up), or

2. Populate frmAddEventData (and its subform) with new data from frmAddPersonalData when the latter is closed.

Thanks!!!!
 
Hi

My suggestion (but I have not tried this!) would be to abondon the use of popup form, instead, use the parameter settings with docmd.openform to open your forms as dialog forms. This gives a similar efffct to pop up, plus you could do the requery code after the Docmd secure in thknowledge that it will not execute until the dialog form has closed.

Hope This Helps

Ken Reay
 
Thanks, that solved the problem I was having...at least as I described it.

What I didn't include before, and what I'm still having trouble with is this:

frmAddEventData contains a subform, frmAddParticipantsList, that contains a field with a value list, based upon a query. The query returns a list of participant names, which the frmAddPersonalData is meant to add to.

How can I get new data entered in frmAddPersonalData to populate the query-based value list in the subform frmAddParticipantsList of frmAddEventData? Calling a requery of frmAddEventData and/or frmAddParticipantsList doesn't seem to work.

 
Hi Again

TRy in Ob Got Focus event of the combo box containing the partipant names, doing a requery on the combobox eg something like

Private Sub cboName_GotFocus
cboName.Requery
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top