473,770 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding the Access 2013 Application during database use...

49 New Member
how in the world do i hide the database window? The thing takes up the whole screen, all my users need are the forms I created... used to be a check box that would let you not display the application... that feature seems to be gone in 2013 =/
Dec 30 '14 #1
23 11020
twinnyfo
3,653 Recognized Expert Moderator Specialist
Here is what I use:

I created a separate module called "modFormUtiliti es". In it are several functions.

Whenever you use these functions, your forms should all be set to Modal and Pop-up. This allows your Forms to have control of the environment, rather than the DB window.

There are some comments in the RestoreForm Function that explains how to use it. Let me know if you run across any snags.

Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. '==============================
  5. '  CONSTANTS FOR DBASE WINDOW
  6. '==============================
  7. Public Const SW_HIDE = 0
  8. Public Const SW_SHOWNORMAL = 1
  9. Public Const SW_SHOWMINIMIZED = 2
  10. Public Const SW_SHOWMAXIMIZED = 3
  11.  
  12. '==========================
  13. '  DBASE WINDOW FUNCTIONS
  14. '==========================
  15. Public Declare Function IsWindowVisible Lib "user32" _
  16.         (ByVal hwnd As Long) _
  17.     As Long
  18. Public Declare Function ShowWindow Lib "user32" _
  19.         (ByVal hwnd As Long, _
  20.         ByVal nCmdShow As Long) _
  21.     As Long
  22.  
  23. '============================
  24. ' FORM MANAGEMENT FUNCTIONS
  25. '============================
  26.  
  27. Public Function fAccessWindow(Optional Procedure As String, _
  28.     Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
  29. '****************************************************************************************
  30. '* Purpose:  Controls the behavior and appearance of the Daatabase window               *
  31. '*           residing on the form, and hence, we reduce the overall size of the FE DB.  *
  32. '* Accepts:  Procedure -    describes the behavior requested                            *
  33. '*           SwitchStatus - (optional) instructs the procedure to switch the current    *
  34. '*                          status of the DB Window                                     *
  35. '*           StatusCheck -  (optional) allows the procedure to check the current status *
  36. '*                          of the DB window to determine whether or not to initiate a  *
  37. '*                          change                                                      *
  38. '****************************************************************************************
  39. On Error GoTo EH
  40.     Dim dwReturn As Long
  41.     If Procedure = "Hide" Then
  42.         dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
  43.     End If
  44.     If Procedure = "Minimize" Then
  45.         dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
  46.     End If
  47.     If Procedure = "Normal" Then
  48.         dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWNORMAL)
  49.     End If
  50.     If Procedure = "Show" Then
  51.         dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
  52.     End If
  53.     If SwitchStatus = True Then
  54.         If IsWindowVisible(hWndAccessApp) = 1 Then
  55.             dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
  56.         Else
  57.             dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
  58.         End If
  59.     End If
  60.     If StatusCheck = True Then
  61.         If IsWindowVisible(hWndAccessApp) = 0 Then
  62.             fAccessWindow = False
  63.         End If
  64.         If IsWindowVisible(hWndAccessApp) = 1 Then
  65.             fAccessWindow = True
  66.         End If
  67.     End If
  68.     Exit Function
  69. EH:
  70.     MsgBox "There was an error resetting the Database Window!  " & _
  71.         "Please contact your Database Administrator.", vbCritical, "Error!"
  72.     Exit Function
  73. End Function
  74.  
  75. Public Function RestoreForm(FormName As String)
  76. '**********************************************************************************
  77. '* Purpose:  Manages the database window, keep the current form on top of others. *
  78. '* Accepts:  FormName is the name of the Form which you want to restore           *
  79. '* Returns:  N/A                                                                  *
  80. '*   Usage:  Add "RestoreForm Me.Form.Name" to the OnOpen event of a form         *
  81. '**********************************************************************************
  82. On Error GoTo EH
  83.     fAccessWindow "Minimize", False, False
  84.     DoCmd.SelectObject acForm, FormName
  85.     DoCmd.Restore
  86.     Exit Function
  87. EH:
  88.     MsgBox "There was an error restoring the Form.  " & _
  89.         "Please contact your Database Administrator.", vbOKOnly, "Error!"
  90.     Exit Function
  91. End Function
Hope this hepps!
Dec 30 '14 #2
sooli
49 New Member
got error from click event... tried changing to modal..and it didn't help (one form will have to be non-modal so the boss man can copy and paste from the form opened by a click event.)

Error I am getting:

The expression On Click you entered as the event property setting produced the following error: constants, Fixed-length strings, arrays, user-defined types and Declare statements not allowed as Public members of object modules
*The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
*There may have been an error evaluating the function, event or macro


I made sure none of your sub names were the same as mine... so * 1 is not the issue...
Dec 31 '14 #3
twinnyfo
3,653 Recognized Expert Moderator Specialist
This code should not run on any OnClick events. The error described does not appear to be associated with any of the code provided, as the error trapping included would not generate any such error. How are you calling the code? It should be in the OnOpen Event of the form.

You can still use Modal for all forms (as the most recently opened form will open on top. You could either close that form after you copy and then paste into the original form or have other ways to transfer data.
Dec 31 '14 #4
sooli
49 New Member
I put the code into the OnOpen event. Error didn't occur till I entered the code, when I removed the code the error went away. When I debugged, it sent me straight to your code where the constants were defined. I'll play with it a bit and see if I can resolve - maybe pinpoint the exact spot that is causing the error... for now everyone is happy with the database as is... so this will be something to provide in a version update later. Thanks for you assistance on this and my other issue.. still trying to work that one out as well...
Jan 4 '15 #5
twinnyfo
3,653 Recognized Expert Moderator Specialist
Is the code I posted in a separate module--all by itself and NOT in a Form. Your Form should only have the following line in the OnOpen event:

Expand|Select|Wrap|Line Numbers
  1. RestoreForm Me.Form.Name
You also did not tell us what the error was when you debugged.
Jan 5 '15 #6
sooli
49 New Member
I did not make a separate module... i put it at the head of the module for the main form. I will try it as a separate module =)

When I debugged, it just put me on the 1st line of code where the constants were declared. I didn't get an explanation =( Only error I got was the one I posted earlier.
Jan 6 '15 #7
jimatqsi
1,277 Recognized Expert Top Contributor
Twinnyfo, this looks to be very useful. I'm having some trouble getting Access 2010 Runtime to behave. People are able to see the database window and even change queries!

Are there any version restrictions with this code?

Perhaps this could be the basis of an article. :)

Jim
Jan 6 '15 #8
twinnyfo
3,653 Recognized Expert Moderator Specialist
sooli,

Have you made any progress on this?
Jan 7 '15 #9
sooli
49 New Member
Twinnyfo!!!! You are AWESOME!!!! I got it to work and didn't have to tweak any of your code! I just had to call it properly!

Sorry took so long to get to this point! Plate is overflowing!

Question... is there anyway to keep the user from bringing the window back? You cannot see it while actively using the database... which is great, however if you hover over the areo peak, you can bring it right back up... and if I try to go back to design view it closes the database...

I did find that I can open the database using shift... and get to the design view which is fine... and I have the working copy of the database set so that navigation and menu's are disabled... so they can't do anything with it... just want it to not be retrievable at all by the user.
Mar 6 '15 #10

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

Similar topics

10
1804
by: skiz | last post by:
I have an application written in ms access 97. Just recently certain queries have been giving various errors -- one of which is "there was an error executing the command". When I ran the application in access 2000, no errors occurred. Any ideas? If I open the database file in 2000 it asks me if I want to convert the database -- so, I know that it is still a 97 database. Thanks! skiz
6
2251
by: SteveS | last post by:
Hello All. I have an asp.net application with 3 different assemblies. They are like this: 1) Assembly: PublicSite (This contains the website UI) Root namespace: PublicSite 2) Assembly: PublicSite.MyProfile.Business (This contains the business rules) Root namespace: PublicSite
3
2124
by: George H. Slamowitz | last post by:
Hello All I am trying to convert a MS Access 2000 application to a VB application (Just Started Yesterday) I am using Visual Studio .NET 2003 utilizing Visual Basic .NET I think I have a good feel to what I have to do, but does anyone know of a GOOD white paper on what is involved, pitfalls, etc?
22
6287
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one client (MS Access vs ..NET Windows Forms) would be preferred over the other. While I have some good arguments on both sides, I would appreciate your points of view on the topic.
5
3210
by: BA | last post by:
Hi there I am trying to write an "application" in Access 2000, that displays a front end and allows the user to interact with the database without seeing Access loaded, in the background, nor on the taskbar. When I click on the generate report button, from the front-end's form, no report/query is displayed. However, if i disable the code that "hides" Access, the reports and queries work perfectly. How do I get this functionality...
1
1450
mikek12004
by: mikek12004 | last post by:
I have a access 2002 application (a file with MDE extension) which when you execute it access 2002 opens and you insert/view/modify data through a series of user-created forms. Assuming that they are stored in a access database I want to get that database in order to create a new application (preferably with php/mysql). So I want to get the application's data. Anyway I could an export or something like that (even getting the data in access...
0
7250
by: steveradaza | last post by:
Sir,Good Day..I am a newbie here and i am just learning the usage of microsoft access..can you help me solve my problem in making a running balance in a query of microsoft access 2013 of my In and Out Investment?here is the attachment of my image for the sample table and the query that i created..please help me...i am doing this table and query for almost 2 months...i beg you all please..thank you in advance...
4
2437
by: nomeepk | last post by:
hi, i am using access 2013, Is there a way i can make this Access Database online, so i can access and use it from anywhere in a Browser? Regards.
5
3409
by: jimatqsi | last post by:
I'm looking for information about compatibility between Access 2013 and Access 2003. I've been approached by a firm that wants to begin upgrading their systems. I want to know if it is reasonable to plan to keep the back-end of an Access database in 2003 format while gradually updating client machines from Office 2003 to Office 2013. The front-end is pretty simplistic. It has about a dozen forms, some or all created in the 90s, no queries...
0
1691
by: LeoVBNET | last post by:
Hi Because VS 2013 dropped SQL COMPACT databases, I need to convert Access 2013 databases into SQL COMPACT in order to be able to use Linq to SQL in VB 2013. Anybody can help me? Thanks
0
9618
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.