By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Chromless forms

P: 6
In Access, I learned how to create forms without borders by removing the caption altogehter and setting Border Style to "None" for the form.

However, I'd like to know if there's a way to make a blank background, or a background with a bitmap (JPEG or BMP). I do NOT want:
  • the database window, toolbars, menu bar
  • standard toolbars (application object in VBA?)
  • menu bar (application object in VBA)

Again, if possible a background image or all white screen.

Any ideas?
Sep 13 '07 #1
Share this Question
Share on Google+
4 Replies


JConsulting
Expert 100+
P: 603
In Access, I learned how to create forms without borders by removing the caption altogehter and setting Border Style to "None" for the form.

However, I'd like to know if there's a way to make a blank background, or a background with a bitmap (JPEG or BMP). I do NOT want:
  • the database window, toolbars, menu bar
  • standard toolbars (application object in VBA?)
  • menu bar (application object in VBA)

Again, if possible a background image or all white screen.

Any ideas?
What you're asking for is not easy to build, nor maintain in Access. You can minimize the actual Database frame itself, without toolbars or anything except a form(s) but as far as I know you cannot hide the icon in the taskbar.

Try this as a test

Create a form. Make that form open when your database opens. Make it's form type Pop-Up.
Now create a shortcut icon on your desktop and go to its properties. Where it says "Run" select minimized.
the application window itself will allow the form to open, but the window will not be visible.
Now, throughout your application you have to make ALL your forms pop-ups and you must create a navigation method to go from form to form, or from form to menu and back.
Where you'll run into problems is when you try to view reports. Reports require the print dialog and that is only available when in preview mode through the interface. So inevitably you will have to close your pop-up forms because the report won't show up in front of them because they are pop-ups, then maximize your application window temporarily, then once you're done with the report, you minimize the app window again and re-open your form(s).
This can be done...it's not pretty and it seems clunky at best when even done correctly. Maybe you should consider looking into a True VB application compiled into an exe that does what you're after.
J
Sep 13 '07 #2

MGrowneyARSI
P: 90
Option Compare Database
Option Explicit

Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3

Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" (ByVal hWnd As Long, _
ByVal nCmdShow As Long) As Long

Function fSetAccessWindow(nCmdShow As Long)

Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm

If Err <> 0 Then
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If

If nCmdShow = SW_SHOWMINIMIZED And loForm.Modal = True Then
MsgBox "Cannot minimize Access with " _
& (loForm.Caption + " ") _
& "form on screen"
ElseIf nCmdShow = SW_HIDE And loForm.PopUp <> True Then
MsgBox "Cannot hide Access with " _
& (loForm.Caption + " ") _
& "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
End If
fSetAccessWindow = (loX <> 0)
End Function


How to use:

Make sure ALL your forms are set to Popup = Yes and Modal = Yes.
Make sure that you have proper error handling in all your code.
Copy the code above and insert it into a new module.
In your form's 'OnLoad' event, do this: Call fSetAccessWindow(0)


Test the code:

Close and reopen your database.

http://www.vbaexpress.com/kb/getarticle.php?kb_id=74
Sep 14 '07 #3

P: 6
Thanks you guys! I believe, however, if you set the MS Access application window to minimize, it will also minimize all forms. In modal mode, this may not be the case, as I haven't tried to minimize Access programatically yet. I just had the form window set to pop up and manually minimized Access. When I did, the form disappeared as well. When I restored Access, the form reappeared in the same position.

I'll have to try out the code and ideas you guys provided and see what I come up.

Thanks again!
Sep 15 '07 #4

P: 6
Okay, the coding above worked fantastically; thanks, MGrowneyARSI!

The only thing is that when it comes to getting Access to actually appear again, it looks like Access becomes unstable. I'm unable to maximize it ever again, and I've had to close the process down (End Task) in Windows Task Manager (Ctrl + Alt + Del). (I've confirmed that both Pop Up and Modal are set to Yes.)

Any ideas on a function to restore the Access application window using a function?

Thanks.
Sep 26 '07 #5

Post your reply

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