Open Database (1 Viewer)

PeteB

Registered User.
Local time
Yesterday, 21:57
Joined
Mar 15, 2016
Messages
78
I am using a modified Northwind database as one of my databases. This is set up so that when opened, an ‘Alert’ (a form) opens automatically. But another form also opens behind the alert form so that when you close the alert form the other form remains open.
I am trying to replicate this in another database but when the alert form is set to open automatically, there is no other form behind it, so that when the alert form is closed the screen is blank.
Can anyone advise as to how to achieve this?
 

isladogs

MVP / VIP
Local time
Today, 04:57
Joined
Jan 14, 2017
Messages
18,178
No need to open both forms at once.
Add code to the close button on the alert form which opens the second form
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:57
Joined
May 7, 2009
Messages
19,156
you should open "the Other form" first.
add code to it's Timer Event to Open the "Alert form".
Make the timer as short as possible, ie: 30 msec.
 

PeteB

Registered User.
Local time
Yesterday, 21:57
Joined
Mar 15, 2016
Messages
78
Hi arnelgp
Thanks for helping me out. Your solution seems the most logical. I have looked at the various methods of achieving but, as I am a relatively inexperienced Access user, I don't understand any of them. Could you please expand a little?
 

isladogs

MVP / VIP
Local time
Today, 04:57
Joined
Jan 14, 2017
Messages
18,178
Obviously use whichever solution you prefer but for info this is what I meant:

Code for a close button on the alert form:

Code:
Private Sub cmdClose_Click()

DoCmd.OpenForm "YourOtherFormNameHere"
DoCmd.Close acForm, Me.Name

End Sub
 

bastanu

AWF VIP
Local time
Yesterday, 21:57
Joined
Apr 13, 2010
Messages
1,401
If you really need both forms open, instead of using the timer event of the first form(which will waste resources as it will trigger every 30msec and you will need to add code to check if the frmAlert is open and if to open it the second time if not and so on) simply add
DoCmd.OpenForm "frmAlert" to the Load event of the first form (that needs to remain visible after you close the alert).

Cheers,
Vlad
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:57
Joined
May 7, 2009
Messages
19,156
Here is a sample. Timer can only occur once.
 

Attachments

  • FormOnBackGround.zip
    20.1 KB · Views: 41

bastanu

AWF VIP
Local time
Yesterday, 21:57
Joined
Apr 13, 2010
Messages
1,401
@arnelgp - I liked that trick, thank you very much!
 

PeteB

Registered User.
Local time
Yesterday, 21:57
Joined
Mar 15, 2016
Messages
78
ridders/arnelgp/bastanu
Thank you so much for your help. What would we amateur Access Users do without you guys?
 

isladogs

MVP / VIP
Local time
Today, 04:57
Joined
Jan 14, 2017
Messages
18,178
On behalf of all of us, you're welcome
You now have 3 solutions - spoilt for choice!
 

Users who are viewing this thread

Top Bottom