First Run

A real begineer

Registered User.
Local time
Today, 22:58
Joined
Nov 4, 2000
Messages
74
My application has a master switchboard, for directing the users to other forms. On first load on first use on first day there is some data that needs collecting and should never be needed again.
I thought it would be a simple matter of telling my master switch that on load to hide itself and pull up another form for input of tank diameter (for example), however when I write the code it does not seem to work.

The tank diameter form pops up and refuses to take the focus.

Below is one of the permetations of code I have tried.

If blnA=False then
Docmd.OpenForm "frmChlTnk",,,stLinkCriterea
Form_FrmMasterSwitchboard.Visible=False
Form_FrmChlTnk.SetFocus
end if

I have attempted changing the order within this code, e.g. make master form invisble before loading and so on.

Currently this code is sitting in the on load event, I have tried locating it in the on open, on activate, on mouse move and a few others.

In all cases it appears to me, the code is running before master form completely loads itself. This results in the tank form, loosing the focus forced in code, I think I need to stop the process, but do not know how.



The_Doc_Man
Junior Member posted 03-06-2001 01:20 PM
--------------------------------------------------------------------------------
Try setting the focus to the desired control on the newly-opened form.
Suppose it is called "NewTankSize"...
try Forms("frmChlTnk")!NewTankSize.SetFocus



A real begineer
Junior Member posted 03-06-2001 01:42 PM
--------------------------------------------------------------------------------
I did try setting the focus to the control on the form, and it still does not seem to respond like I thought it would.
I think the switchboard is continuing to load post the code, and I think this is the problem.

So in essence, for a millisecond or less the form has focus, however, the switchboard continues to load and takes the focus away. I think I need to stop the load until the tank form is completed but I am not sure how.
 
you don't have to hide the switchboard, as the popup will be on top and have focus when you open it.

You open your popup and you have focus correctly (if your tab order is correct and you can modify that).

When changing focus from one form to an object on another form, you first have to first set focus on the new form, then setfocus on the new object on that form.
 
For data that only has to be collected once, ever, do it manually.
 
In the on open event of masterswitchboard, simply open frmChlTnk move the validation to frmChlTnk and just close it if your validation requirements are met, set frmChlTnk modal popup properties to yes and add any further code you need to ensure that required data has been entered.
HTH
 

Users who are viewing this thread

Back
Top Bottom