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 =/
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. - Option Compare Database
-
Option Explicit
-
-
'==============================
-
' CONSTANTS FOR DBASE WINDOW
-
'==============================
-
Public Const SW_HIDE = 0
-
Public Const SW_SHOWNORMAL = 1
-
Public Const SW_SHOWMINIMIZED = 2
-
Public Const SW_SHOWMAXIMIZED = 3
-
-
'==========================
-
' DBASE WINDOW FUNCTIONS
-
'==========================
-
Public Declare Function IsWindowVisible Lib "user32" _
-
(ByVal hwnd As Long) _
-
As Long
-
Public Declare Function ShowWindow Lib "user32" _
-
(ByVal hwnd As Long, _
-
ByVal nCmdShow As Long) _
-
As Long
-
-
'============================
-
' FORM MANAGEMENT FUNCTIONS
-
'============================
-
-
Public Function fAccessWindow(Optional Procedure As String, _
-
Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
-
'****************************************************************************************
-
'* Purpose: Controls the behavior and appearance of the Daatabase window *
-
'* residing on the form, and hence, we reduce the overall size of the FE DB. *
-
'* Accepts: Procedure - describes the behavior requested *
-
'* SwitchStatus - (optional) instructs the procedure to switch the current *
-
'* status of the DB Window *
-
'* StatusCheck - (optional) allows the procedure to check the current status *
-
'* of the DB window to determine whether or not to initiate a *
-
'* change *
-
'****************************************************************************************
-
On Error GoTo EH
-
Dim dwReturn As Long
-
If Procedure = "Hide" Then
-
dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
-
End If
-
If Procedure = "Minimize" Then
-
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
-
End If
-
If Procedure = "Normal" Then
-
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWNORMAL)
-
End If
-
If Procedure = "Show" Then
-
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
-
End If
-
If SwitchStatus = True Then
-
If IsWindowVisible(hWndAccessApp) = 1 Then
-
dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
-
Else
-
dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
-
End If
-
End If
-
If StatusCheck = True Then
-
If IsWindowVisible(hWndAccessApp) = 0 Then
-
fAccessWindow = False
-
End If
-
If IsWindowVisible(hWndAccessApp) = 1 Then
-
fAccessWindow = True
-
End If
-
End If
-
Exit Function
-
EH:
-
MsgBox "There was an error resetting the Database Window! " & _
-
"Please contact your Database Administrator.", vbCritical, "Error!"
-
Exit Function
-
End Function
-
-
Public Function RestoreForm(FormName As String)
-
'**********************************************************************************
-
'* Purpose: Manages the database window, keep the current form on top of others. *
-
'* Accepts: FormName is the name of the Form which you want to restore *
-
'* Returns: N/A *
-
'* Usage: Add "RestoreForm Me.Form.Name" to the OnOpen event of a form *
-
'**********************************************************************************
-
On Error GoTo EH
-
fAccessWindow "Minimize", False, False
-
DoCmd.SelectObject acForm, FormName
-
DoCmd.Restore
-
Exit Function
-
EH:
-
MsgBox "There was an error restoring the Form. " & _
-
"Please contact your Database Administrator.", vbOKOnly, "Error!"
-
Exit Function
-
End Function
Hope this hepps!
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...
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.
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...
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:
You also did not tell us what the error was when you debugged.
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.
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
twinnyfo 3,653
Recognized Expert Moderator Specialist
sooli,
Have you made any progress on this?
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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
|
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
|
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?
|
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.
|
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...
| |
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...
|
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...
|
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.
|
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...
|
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
|
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...
| |
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...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |