473,385 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can you have 2 access forms open on 2 different monitor screens?

Hi,

I actually have 3 questions:

1. I work with 2 separate monitors. Working in one Access database, is it possible to have 1 forms open on 1 monitor, and the other form open on the other monitor?

2. How do you set up Access so the program runs in the backround and all user sees on their screen is a form?

3. I'm thinking of creating a blog for an open source programming project done in Access. I haven't seen this done before. Does anyone know the URL of such a project?

Thanks,
Adam
Sep 18 '09 #1

✓ answered by ajalwaysus

Definitely you can hide the app, I have a switchboard program that does exactly that. Create a module and input this code:

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Public Enum nWindowState
  5.     cHIDE = 0
  6.     cSHOWNORMAL = 1
  7.     cSHOWMINIMIZED = 2
  8.     cSHOWMAXIMIZED = 3
  9.     cSHOWMINNOACTIVE = 7
  10.     cSHOWDEFAULT = 10
  11. End Enum
  12.  
  13. Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
  14.  
  15. Public Function ShowAppWindow(Optional WindowState As nWindowState = cHIDE)
  16.  Call ShowWindow(Application.hWndAccessApp, WindowState)
  17. End Function
  18.  
Then on the load of the form, execute the following line of code:

Expand|Select|Wrap|Line Numbers
  1. ShowAppWindow cHIDE
  2.  
Let me know if this works for your needs.
-AJ

13 9772
ajalwaysus
266 Expert 100+
This is assuming you run MS Access 2003 (I know NOTHING about 2007)

I can answer your first question:
1. No you cannot run the same app on separate screens, because when you open a form it is actually running over your access app, and since you cannot split the access app between 2 screens you cannot have 2 forms on separate screens. (If someone proves me wrong that would be great, I have always wanted to do this!)

2.What exactly are you wanting to do as it relates to question 2.

3. I cannot answer this, not my area.

-AJ
Sep 18 '09 #2
NeoPa
32,556 Expert Mod 16PB
  1. It certainly is. You would ensure Access is stretched across both monitors and simply place each opened form in its own monitor. This would clearly involve both forms being open at the same time in a single instance of Access. It is also not possible (remotely straightforwardly) to run code from both concurrently. Having said that a form in it's normal open state is idle awaiting action by the operator. Either can be used while the other is idle.
  2. I guess you mean the Database window is hidden rather than the code runs in the background (The code always runs in the background). There are two ways to achieve this, both of which involve simply hiding the Database window.
    1. The Tools / Startup form has an option to start the database without showing the Database window.
    2. With the Database window selected choose Window / Hide.
  3. No idea.
Sep 18 '09 #3
ajalwaysus
266 Expert 100+
I guess to question 2, I ask what exactly you want to do, because I have a method where I run a reporting DB in the background on peoples PCs, but I completely hide the app. and they don't know it's running. This way there is no way they can close the app midway through the process, without ending the process in Task Manager.

NeoPa, glad we agree on Q.3. =P

-AJ
Sep 18 '09 #4
NeoPa,

Oh, by the way, I'm in Access 2007

Clever! I see that I can minimize the Access program and stretch it across the two monitors, but when I maximize it, it snaps back and fills only one monitor. Since the two monitors are not identical size, the stretch across makes everything appear a little confusing. It works, but is there a cleaner way to do this? I know programs (like Adobe Flash) that can be maximized across both screens.

If not, is there a way to set an Access database so that when you open it, the access program automatically stretches across both monitors?

In reference to my second question...

Lets say I open a pop-up form. Now I have the form on top and the Access program takes up the screen in the background. Is it possible to make the access program in the background invisible, but the access pop-up form remains visible, still on the screen, and fully functional? The pop-up form would appear to be a stand-alone program.

Thanks,
Adam
Sep 18 '09 #5
ajalwaysus
266 Expert 100+
Definitely you can hide the app, I have a switchboard program that does exactly that. Create a module and input this code:

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Public Enum nWindowState
  5.     cHIDE = 0
  6.     cSHOWNORMAL = 1
  7.     cSHOWMINIMIZED = 2
  8.     cSHOWMAXIMIZED = 3
  9.     cSHOWMINNOACTIVE = 7
  10.     cSHOWDEFAULT = 10
  11. End Enum
  12.  
  13. Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
  14.  
  15. Public Function ShowAppWindow(Optional WindowState As nWindowState = cHIDE)
  16.  Call ShowWindow(Application.hWndAccessApp, WindowState)
  17. End Function
  18.  
Then on the load of the form, execute the following line of code:

Expand|Select|Wrap|Line Numbers
  1. ShowAppWindow cHIDE
  2.  
Let me know if this works for your needs.
-AJ
Sep 18 '09 #6
AJ, Bravo!!!

Hey, it appears that the forms can float beyond the stretched borders!

So, in theory, you can stretch the app across two (or more!) monitors, make it invisible, and have several Access pop up forms floating on both screens!

Now if I can figure out how to open a specific database, have that database run code to minimize the app, stretch it across both screens, open a pop-up switch board form, and then use AJ's code to hide the app, we got it all!

THIS IS AWESOME!!!

Hey AJ, to make the app appear again, I assume you can put a button or something on the switch board and run the counter command for "CHIDE".

Would you happen to know what that would be? "CAPPEAR"???

Thanks!
Adam
Sep 18 '09 #7
ajalwaysus
266 Expert 100+
Under the "Public Enum nWindowState" in the code I provided, is all the possible window manipulations.

I can probably help you some more since I have experience in this, but without handing you everything, post specific questions that we can help you with. (I believe people learn more by asking specific questions)

Also, I have to admit it never occurred to me that forms could float across screens if I hid the app window, I shall look into this more down the road. =)

-AJ
Sep 18 '09 #8
NeoPa
32,556 Expert Mod 16PB
@ajalwaysus
Well, we're both experts for goodness sake. We ought to agree on something at least :D
Sep 18 '09 #9
AJ, NeoPa

After some minor tweaking, it is perfect! Here's the details:

I created a module like AJ described above and inserted his code.

I created a from called fm_testfrom.
Properties:
Pop Up = Yes
Modal = Yes

I created a second form called fm_MainMenu.
Properties:
Pop Up = Yes
Modal = Yes
This form had 2 buttons; one to toggle the application show/hide, the other to open fm_testform.

The key to making this work: When the application is hidden, any form you want to open must be set to Pop up=Yes AND Modal=Yes. Once the form is open, you can set Modal=No. The form will remain visible, but this change will cause the form to go to the back of the stacking order. Use GetFocus to bring it back up front.

You don't even have to stretch the application!

Now all forms will float over the desk top like stand-alone applications and can even be dragged across multiple screens!

Just be careful. If you shut down the form with the toggle button, Access will stay hidden but keep running in the background. You'll need the task manager to shut it down from there.

Thank you both for your help!
Adam

The Code Below was in fm_MainMenu
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2.  
  3. Private Sub openTest_Click()
  4.     DoCmd.OpenForm "fm_testform"
  5.     Forms.fm_testform.Modal = False
  6.     Forms.fm_testform.SetFocus
  7.  
  8. End Sub
  9.  
  10. Private Sub ShowHideAppButton_Click()
  11.  If Me.ShowHideAppButton.Caption = "Hide Application" Then
  12.     'make the application invisible and change button caption
  13.     Me.Modal = True
  14.     ShowAppWindow cHIDE
  15.     Me.ShowHideAppButton.Caption = "Show Application"
  16.     Me.Modal = False
  17.  
  18.  
  19.  Else
  20.     'make the application visible and change button caption
  21.     Me.Modal = True
  22.     ShowAppWindow cSHOWNORMAL
  23.     Me.ShowHideAppButton.Caption = "Hide Application"
  24.     Me.Modal = False
  25.  
  26.  End If
  27. End Sub
Sep 18 '09 #10
NeoPa
32,556 Expert Mod 16PB
Thanks for posting Adam. It's always good to see a resolution posted. Please remember to use the CODE tags though for all code posted.

You mention closing Access when the last form is closed. This needn't be too much of an issue. Some simple timer code can run from a hidden (always open while the database is open) form which checks the CurrentDb.Forms collection. As soon as no other forms appear in the collection it could close Access for you.
Sep 18 '09 #11
@NeoPa
Cool!

NeoPa,

Thanks for fixing my post. Can you link me to something that will teach me how to use code tags?

Thanks, Adam
Sep 19 '09 #12
NeoPa
32,556 Expert Mod 16PB
I can certainly do that.

Let me know if you still have trouble after this.

Tags are done as matching pairs where the opening one is surrounded by [...] and the closing one by [/...]. A set of buttons is available for ease of use in the Standard Editor (Not the Basic Editor). The one for the [ CODE ] tags has a hash (#) on it. You can choose which editor to use in your Profile Options (Look near the bottom of the page).
Sep 19 '09 #13
NeoPa
32,556 Expert Mod 16PB
A new member posted his question in here so it's now been moved to Modal Form.
Sep 25 '09 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: mamatha | last post by:
Hi I have Access forms and i want to add our company's logo to that form.How can i add,if any one knows let me know.
13
by: Seth Spearman | last post by:
Hey guys, I have the following code: '****************************************************** If Not Me.NewRecord Then Dim rs As DAO.Recordset Dim strBookmark As String Set rs =...
7
by: James Fortune | last post by:
In response to different users or situations (data context) I transform the appearance and characteristics of Access Forms through code. This seems to fit in with the idea of polymorphism. Do...
3
by: Vic | last post by:
Hi all, I am trying to set different background color based on text box value on a form. Basically, I have one form that display many lines of records(record source is a query), in each of the...
8
by: carriolan | last post by:
Hi I have an MS Access based application almost ready for distribution to the public and I find that even though I have compiled it into an MDE file, tables and queries can still be be imported if...
3
by: mumbaimacro | last post by:
hi i am a newbie to access programming,, i need help to 1. view PDF inside Ms-access forms whether the PDF Location from the Folder or the Path in table. 2. view ms- photoeditor...
6
by: Bob Alston | last post by:
Looking for someone with experience building apps with multiple instances of forms open. I am building an app for a nonprofit organizations case workers. They provide services to the elderly. ...
19
by: jalmar | last post by:
My question is related to Access forms. I have set up an Access form using 4 different tables~I am pulling 2 different numbers and the name of Trusts out of one table, I am pulling custodian name...
1
by: Joe Farage | last post by:
Is there any way to have Access open the forms that were created and to hide the actual Access program? For instance, when the user opens the database, it is set up to automatically open a certain...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.