Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 06-14-2018, 03:42 AM   #1
PeteB
Newly Registered User
 
Join Date: Mar 2016
Location: Northants, England
Posts: 39
Thanks: 11
Thanked 4 Times in 4 Posts
PeteB is on a distinguished road
Open Database

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?

PeteB is offline   Reply With Quote
Old 06-14-2018, 03:50 AM   #2
ridders
Newbee moderator
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 5,301
Thanks: 77
Thanked 1,294 Times in 1,209 Posts
ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough
Re: Open Database

No need to open both forms at once.
Add code to the close button on the alert form which opens the second form
__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left and leave a comment.

New example databases:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ridders is offline   Reply With Quote
Old 06-14-2018, 04:23 AM   #3
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 6,136
Thanks: 54
Thanked 1,968 Times in 1,881 Posts
arnelgp is a jewel in the rough arnelgp is a jewel in the rough arnelgp is a jewel in the rough arnelgp is a jewel in the rough
Re: Open Database

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.

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 06-14-2018, 07:17 AM   #4
PeteB
Newly Registered User
 
Join Date: Mar 2016
Location: Northants, England
Posts: 39
Thanks: 11
Thanked 4 Times in 4 Posts
PeteB is on a distinguished road
Re: Open Database

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?
PeteB is offline   Reply With Quote
Old 06-14-2018, 07:35 AM   #5
ridders
Newbee moderator
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 5,301
Thanks: 77
Thanked 1,294 Times in 1,209 Posts
ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough
Re: Open Database

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
__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left and leave a comment.

New example databases:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ridders is offline   Reply With Quote
Old 06-14-2018, 08:59 AM   #6
bastanu
Registered User
 
Join Date: Apr 2010
Location: Kelowna, Canada
Posts: 135
Thanks: 0
Thanked 43 Times in 43 Posts
bastanu is on a distinguished road
Re: Open Database

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
bastanu is offline   Reply With Quote
Old 06-14-2018, 09:28 AM   #7
arnelgp
Registered User
 
arnelgp's Avatar
 
Join Date: May 2009
Location: somewhere out there
Posts: 6,136
Thanks: 54
Thanked 1,968 Times in 1,881 Posts
arnelgp is a jewel in the rough arnelgp is a jewel in the rough arnelgp is a jewel in the rough arnelgp is a jewel in the rough
Re: Open Database

Here is a sample. Timer can only occur once.
Attached Files
File Type: zip FormOnBackGround.zip (20.1 KB, 6 views)

__________________
"Never stop learning, because life never stops teaching"
arnelgp is offline   Reply With Quote
Old 06-14-2018, 02:32 PM   #8
bastanu
Registered User
 
Join Date: Apr 2010
Location: Kelowna, Canada
Posts: 135
Thanks: 0
Thanked 43 Times in 43 Posts
bastanu is on a distinguished road
Re: Open Database

@arnelgp - I liked that trick, thank you very much!
bastanu is offline   Reply With Quote
Old 06-14-2018, 11:44 PM   #9
PeteB
Newly Registered User
 
Join Date: Mar 2016
Location: Northants, England
Posts: 39
Thanks: 11
Thanked 4 Times in 4 Posts
PeteB is on a distinguished road
Re: Open Database

ridders/arnelgp/bastanu
Thank you so much for your help. What would we amateur Access Users do without you guys?
PeteB is offline   Reply With Quote
Old 06-15-2018, 12:13 AM   #10
ridders
Newbee moderator
Gold Supporter
 
ridders's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 5,301
Thanks: 77
Thanked 1,294 Times in 1,209 Posts
ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough ridders is a jewel in the rough
Re: Open Database

On behalf of all of us, you're welcome
You now have 3 solutions - spoilt for choice!

__________________
Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left and leave a comment.

New example databases:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
ridders is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
desktop icon for the database moves every time I open/close the database JSH20120710 Modules & VBA 4 07-11-2013 01:24 PM
SQL Login X out fails to open the database with the form set to open to tmedzyk SQL Server 0 04-10-2012 12:39 PM
Access Database command button to open external database ttbeverley Modules & VBA 2 12-14-2009 08:32 PM
On Open database form open and maximise dntel123 Modules & VBA 3 04-17-2009 09:42 AM
Open ADODB.Connection to already open Database yeatmanj Modules & VBA 1 01-26-2005 12:59 PM




All times are GMT -8. The time now is 11:01 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World