Question VBA Code to open form

DanJames

Registered User.
Local time
Today, 02:58
Joined
Sep 3, 2009
Messages
78
I have an opening form and the on_load says:

If nRecord >1 Then
'OPEN THE FORM CLIENTNOCLEANER1
Else
'DO NOTHING, Just stay on the opening form.

However it opens the opening form and the CLIENTNOCLEANER1 behind the opening form.

I would like the CLIENTNOCLEANER1 form to open above the opening form, and even better to be able to open before the CLIENTNOCLEANER1 form and then the opening form.

Thanks in Advance?
 
Your last sentence (before 'thanks') is confusing.

Opening a form is a DoCmd.Open, which you can look up in the Help files.

Logic in VBA on an opening form is fine. You can certainly make a logical decision based on some record count, and if that means you want to open a specific form, go for it. As to whether the opening form is top or bottom, you can open the form and then do a Move to Top operation. Or you can make the newly opened form do that for itself, which is usually easier.

This "move to top" is a menu-bar action, so that would again be a DoCmd based on the Edit (or is it View?) menu. I'm not where I can easily look that up, but it is an Office action dealing with menu bars. Should be possible to automate a menu bar action with a little Help browsing.
 
OK Thanks, Instead I have created a "portal-like" form which takes you to whatever form needed when the user clicks an "Enter" button.
 

Users who are viewing this thread

Back
Top Bottom