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
Definitely you can hide the app, I have a switchboard program that does exactly that. Create a module and input this code: -
Option Compare Database
-
Option Explicit
-
-
Public Enum nWindowState
-
cHIDE = 0
-
cSHOWNORMAL = 1
-
cSHOWMINIMIZED = 2
-
cSHOWMAXIMIZED = 3
-
cSHOWMINNOACTIVE = 7
-
cSHOWDEFAULT = 10
-
End Enum
-
-
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
-
-
Public Function ShowAppWindow(Optional WindowState As nWindowState = cHIDE)
-
Call ShowWindow(Application.hWndAccessApp, WindowState)
-
End Function
-
Then on the load of the form, execute the following line of code:
Let me know if this works for your needs.
-AJ
13 9772
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
NeoPa 32,556
Expert Mod 16PB - 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.
- 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.
- The Tools / Startup form has an option to start the database without showing the Database window.
- With the Database window selected choose Window / Hide.
- No idea.
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
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
Definitely you can hide the app, I have a switchboard program that does exactly that. Create a module and input this code: -
Option Compare Database
-
Option Explicit
-
-
Public Enum nWindowState
-
cHIDE = 0
-
cSHOWNORMAL = 1
-
cSHOWMINIMIZED = 2
-
cSHOWMAXIMIZED = 3
-
cSHOWMINNOACTIVE = 7
-
cSHOWDEFAULT = 10
-
End Enum
-
-
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
-
-
Public Function ShowAppWindow(Optional WindowState As nWindowState = cHIDE)
-
Call ShowWindow(Application.hWndAccessApp, WindowState)
-
End Function
-
Then on the load of the form, execute the following line of code:
Let me know if this works for your needs.
-AJ
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
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
NeoPa 32,556
Expert Mod 16PB @ajalwaysus
Well, we're both experts for goodness sake. We ought to agree on something at least :D
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 - Option Compare Database
-
-
Private Sub openTest_Click()
-
DoCmd.OpenForm "fm_testform"
-
Forms.fm_testform.Modal = False
-
Forms.fm_testform.SetFocus
-
-
End Sub
-
-
Private Sub ShowHideAppButton_Click()
-
If Me.ShowHideAppButton.Caption = "Hide Application" Then
-
'make the application invisible and change button caption
-
Me.Modal = True
-
ShowAppWindow cHIDE
-
Me.ShowHideAppButton.Caption = "Show Application"
-
Me.Modal = False
-
-
-
Else
-
'make the application visible and change button caption
-
Me.Modal = True
-
ShowAppWindow cSHOWNORMAL
-
Me.ShowHideAppButton.Caption = "Hide Application"
-
Me.Modal = False
-
-
End If
-
End Sub
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.
@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
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).
NeoPa 32,556
Expert Mod 16PB
A new member posted his question in here so it's now been moved to Modal Form.
Sign in to post your reply or Sign up for a free account.
Similar topics
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.
|
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 =...
|
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...
|
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...
|
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...
|
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...
|
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.
...
|
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...
|
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...
|
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...
|
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...
|
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
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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,...
| |