Switchboard / Custom form load on startup.. (1 Viewer)

GUIDO22

Registered User.
Local time
Today, 06:20
Joined
Nov 2, 2003
Messages
515
I have a Switchboard panel/form , set as 'Popup' this is the primary panel for my DB application.

....this has been fine for many years, however I am implementing a new panel for time bookings for our workshop where operators of machine tools will likely have oily hands and I want to mimise interaction with keyboard and mouse for obvious reasons. (They will be interacting with a touchscreen monitor, the forms will have appropriately sized controls for such interaction...)

So when Access loads, for this PC in the workshop , I want the booking panel to appear by default. I have identified the MAC address for the PC in question and my code will identify this PC when the program runs. The only way I have considered this working is for the Switchboard to load as normal but having identified the PC from the MAC -I have hardcoded the Switchboard button sequence to display the booking form (as this is the only form I need the operators to have access to).

I have done this in the Switchboards Open event but the Switchboard panel is overlaid on top of the booking form once the Open() event has completed.
How can I force the Switchboard to retire behind the booking form? I had tried setting the booking form to Modal, setting focus to the booking form etc, but this made no difference...

An alternative (better?) method to complete what I am attempting would be happily considered.

Thanks in advance...
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:20
Joined
May 7, 2009
Messages
19,245
you may try to open your switchboard on the Timer Event of the booking panel.
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:20
Joined
Sep 21, 2011
Messages
14,310
So load one or the other. You said all they need to use is the booking form, so why let a switchboard get involved?
 

GUIDO22

Registered User.
Local time
Today, 06:20
Joined
Nov 2, 2003
Messages
515
So load one or the other. You said all they need to use is the booking form, so why let a switchboard get involved?
The Switchboard is my Startup form...
 

GUIDO22

Registered User.
Local time
Today, 06:20
Joined
Nov 2, 2003
Messages
515
you may try to open your switchboard on the Timer Event of the booking panel.
Hi, can you elaborate here please..?
The application displays the Switchboard as startup form. Those that need to use the booking panel are comparatively few in number...

Ideally, am i able to stipulate a different Startup form for different groups of users?... Could i do this with a 'Sub Main()' module type arrangement?...
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:20
Joined
May 7, 2009
Messages
19,245
what does the "startup" form do?
for course you can create different startup forms for different groups/individual.
create a Function that will "selectively" open the form depending of which group
the user belongs.
then call this on autoexec macro.

if you can upload a sample version, anybody can look what needs to be done
in order for your db to "work" as you intended it.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 06:20
Joined
Feb 19, 2013
Messages
16,616
Why not just hide the switchboard form on open and only make it visible if not on the specific machine?

other thing to try is to set the focus to the other form when opened
 

GUIDO22

Registered User.
Local time
Today, 06:20
Joined
Nov 2, 2003
Messages
515
Why not just hide the switchboard form on open and only make it visible if not on the specific machine?

other thing to try is to set the focus to the other form when opened
As initially stated, have already tried that... Figured having it the open() event may have been the issue so moved the relevant code to Activate(), Gotfocus() etc. But same result each time... Switchboard remained visible and in view..
 

GUIDO22

Registered User.
Local time
Today, 06:20
Joined
Nov 2, 2003
Messages
515
what does the "startup" form do?
for course you can create different startup forms for different groups/individual.
create a Function that will "selectively" open the form depending of which group
the user belongs.
then call this on autoexec macro.

if you can upload a sample version, anybody can look what needs to be done
in order for your db to "work" as you intended it.
In the DB project options you can select the form you want as the startup form... Mine is set to the Switchboard....
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:20
Joined
Sep 21, 2011
Messages
14,310
In the DB project options you can select the form you want as the startup form... Mine is set to the Switchboard....
Yes, and you could just as easy have a dummy form that decides which form to open as your next form, be it the switchboard or the data entry form. That dummy closes itself.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 06:20
Joined
Feb 19, 2013
Messages
16,616
As initially stated, have already tried that...
sorry, wasn't clear enough - I meant open with autoexec macro, rather than the open with form property. Autoexec macro can open it hidden as one of the parameters of openform. You might even be able to run your MAC identifcation code from the macro and just open the other form when appropriate
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:20
Joined
Feb 19, 2002
Messages
43,293
Personally, I almost never allow multiple forms to be open at one time and I NEVER allow the switchboard to be visible once another form is opened. SO - on the line After the OpenForm method, I hide the current form ---
Me.Visible = False.
I also pass in the name of the form that opened the form, so the whole code from the menu form is the following for the command that opens a form in normal view. The last argument is OpenArgs and Me.Name = the name of the current form which at this point is the name of the switchboard.
Code:
        ' Open a form.
        Case conCmdOpenFormBrowse
            DoCmd.OpenForm rst![Argument], , , , , , Me.Name
            Me.Visible = False
Then, in the Close event of every form, I have this code:
Code:
Private Sub Form_Close()
    If Me.OpenArgs & "" = "" Then
        DoCmd.OpenForm "Switchboard"
    Else
        DoCmd.OpenForm Me.OpenArgs
    End If
End Sub
So, when the called form closes, it either opens the form that opened it or it opens the switchboard if the OpenArgs is null. When you "open" a hidden form, it just becomes visible again.
 

jaikaoliver

Member
Local time
Yesterday, 22:20
Joined
Nov 18, 2019
Messages
37
Personally, I almost never allow multiple forms to be open at one time and I NEVER allow the switchboard to be visible once another form is opened. SO - on the line After the OpenForm method, I hide the current form ---
Me.Visible = False.
I also pass in the name of the form that opened the form, so the whole code from the menu form is the following for the command that opens a form in normal view. The last argument is OpenArgs and Me.Name = the name of the current form which at this point is the name of the switchboard.
Code:
        ' Open a form.
        Case conCmdOpenFormBrowse
            DoCmd.OpenForm rst![Argument], , , , , , Me.Name
            Me.Visible = False
Then, in the Close event of every form, I have this code:
Code:
Private Sub Form_Close()
    If Me.OpenArgs & "" = "" Then
        DoCmd.OpenForm "Switchboard"
    Else
        DoCmd.OpenForm Me.OpenArgs
    End If
End Sub
So, when the called form closes, it either opens the form that opened it or it opens the switchboard if the OpenArgs is null. When you "open" a hidden form, it just becomes visible again.
I like this approach.
Can you please make for me a sample db with the above code.
Thanks
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:20
Joined
Feb 19, 2002
Messages
43,293
Feel free to download any of my sample databases. Most of them work this way. Here is a link to one of them designed specifically to show this functionality.

 

GUIDO22

Registered User.
Local time
Today, 06:20
Joined
Nov 2, 2003
Messages
515
what does the "startup" form do?
for course you can create different startup forms for different groups/individual.
create a Function that will "selectively" open the form depending of which group
the user belongs.
then call this on autoexec macro.

if you can upload a sample version, anybody can look what needs to be done
in order for your db to "work" as you intended it.
I have the Autoexec macro defined and a SubMacro within to Runcode, which calls : db_Startup()

I have the Sub db_Startup() defined in a standard module named : 'Module1'..

But when I run the Autoexec, it errors (error code #2425): expression entered has a function name that cant be found....

I have tried prefixing the call to db_Startup with the module name but no joy..
Any ideas...?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:20
Joined
Feb 19, 2002
Messages
43,293
@GUIDO22 Did you look at the sample I posted in #14? It shows how to hide the current form when opening another form and then when that other form closes, reopening the form that called it.
 

GUIDO22

Registered User.
Local time
Today, 06:20
Joined
Nov 2, 2003
Messages
515
I did , thanks.. Just considering all the options
 

Users who are viewing this thread

Top Bottom