Reference a form

S

swas

Hello,

I have a popup form frmPopup which stays visible. When I click the
occasional button on this form, I want the focus to jump straight back to my
frmMain.

frmPopup has a property to set where the focus should be set back to.
Currently it is a string, but could easily be changed to an control or form
data type.

So with the focus property set to, say 'frmMain', I am not sure on correct
syntax to actually set the focus back to this form. I have tried
CurrentProject, AllForms and Forms objects / collections, using the item
property, to no avail.

To make it worse, the calling form may even be a subform. I am assuming no
matter, so long as the correct information is able to be set / retrieved.

Thanks for any thoughts.


swas
 
M

Marshall Barton

swas said:
I have a popup form frmPopup which stays visible. When I click the
occasional button on this form, I want the focus to jump straight back to my
frmMain.

frmPopup has a property to set where the focus should be set back to.
Currently it is a string, but could easily be changed to an control or form
data type.

So with the focus property set to, say 'frmMain', I am not sure on correct
syntax to actually set the focus back to this form. I have tried
CurrentProject, AllForms and Forms objects / collections, using the item
property, to no avail.

To make it worse, the calling form may even be a subform. I am assuming no
matter, so long as the correct information is able to be set / retrieved.


You would need a set of properties so you can deal with the
possible subform scenario and then maybe a future
subsubform.

This sounds like a messy situation that's just trying to
simulate a tool bar. If so, why not create a custom tool
bar? At least then the focus never leaves wherever it is
when a tool bar button is used.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top