|
Access VBA Discuss using VBA for Access programming. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
March 10th, 2005, 01:19 PM
|
Registered User
|
|
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
user interface
How to have an Access GUI interface hidden during an application run-time? I want a user to be able to see only selected forms and windows and not realize that Access application is running.
|
March 10th, 2005, 03:14 PM
|
Friend of Wrox
|
|
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
|
|
Hi,
It sounds like you want VB.Net to make your Access interface. It is not much different than using Access VBA.
HTH
mmcdonal
|
March 10th, 2005, 07:47 PM
|
Friend of Wrox
|
|
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
You will need to write an SDI application to do that.
Accessâ programming interface does not allow that. The data from the tables in an MDB can be accessed by an SDI app, but you cannot write an SDI app with just Access as your environment.
You could âfake itâ by having a series of Access apps that all use just one form, maximized in the parent window, but sheesh!, what a nightmare [u]that</u> would be to write and maintain!
|
March 11th, 2005, 10:03 AM
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You could do what I do... have the Access (host window) re-size itself upon startup and then center itself on the user's screen. All of the forms (including switchboard) open as pop-ups over top of the "reduced" host window. User's never see it. They only see the forms.
Here's the code I use to re-size and position the "host" window.
Function SizeAccess(cX As Long, cy As Long, _
cHeight As Long, cWidth As Long)
Dim h As Long
'Get handle to Microsoft Access.
h = Application.hWndAccessApp
'Position Microsoft Access.
SetWindowPos h, HWND_TOP, cX, cy, cWidth, _
cHeight, SWP_NOZORDER
End Function
Rick
|
March 13th, 2005, 12:27 PM
|
Authorized User
|
|
Join Date: Sep 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I tried the solution posted by Rick but came unstuck with the following:
SetWindowPos h, HWND_TOP, cX, cy, cWidth, _
cHeight, SWP_NOZORDER
SetWindowPos is undefined as its HWNF_TOP and SWP_NOZORDER?
Thanks
Paul
|
March 14th, 2005, 09:50 AM
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry... I forgot to include very important step. In the Autoexec macro of your db, you'll want to add the following FUNCTION NAME reference: SizeAccess (450,355,25,160)
This should put the minimized "shell" window" right dead center of your screen so that forms open over top of it. You can play around with the numbers to get it where you want it.
Give it a try and let me know how you make out.
Rick
|
March 14th, 2005, 09:52 AM
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
And you'll need the following declarations:
Declare Sub SetWindowPos Lib "user32" (ByVal hwnd&, _
ByVal hWndInsertAfter&, _
ByVal x&, ByVal Y&, ByVal cX&, _
ByVal cy&, ByVal wFlags&)
Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long
'Moves MS Access window to top of Z-order.
Global Const HWND_TOP = 0
Global Const SWP_NOZORDER = &H4 'Ignores the hWndInsertAfter.
Rick
|
|
|