On Load event

A real begineer

Registered User.
Local time
Today, 21:55
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.
 
Try setting the focus to the desired control on the newly-opened form.

Suppose it is called "NewTankSize"...
try Forms("frmChlTnk")!NewTankSize.SetFocus
 
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.
 

Users who are viewing this thread

Back
Top Bottom