View Full Version : Shaped forms


___
01-19-2006, 07:31 AM
Unzip the folder to your desktop and open the db :)

popeye
01-19-2006, 08:31 AM
How is that done? Ive wanted to be able to run my forms without the access environment and this somehow shows that as a very real possibility.

KenHigg
01-19-2006, 02:51 PM
Pretty snazzy... Wonder if you can do anything usefull with it? You should do Flash stuff :):):)

___
01-20-2006, 02:10 AM
Pretty snazzy... Wonder if you can do anything usefull with it? You should do Flash stuff :):):)


Maybe create several car shaped forms and use DoCmd.MoveSize on a timer event to race them around the screen....We could have bets and everything :rolleyes:

:D

StevenS
01-20-2006, 02:39 AM
Very Nice!
Is there a way to open the form with the access environment to take a look at the code you used?

Steven

alastair69
01-20-2006, 02:49 AM
Click once on the database and then holding the shift key double click only let go of the shidt key when the database windows is visable.

Alastair

___
01-20-2006, 07:37 AM
How is that done? Ive wanted to be able to run my forms without the access environment and this somehow shows that as a very real possibility.

To do this, all your forms will need to be set up as pop up = Yes, Modal = Yes and all your error handling must be correct or your database will open without being visible and you'll need to reboot to amend the errors because it will not even be visible in the Task Manager.

Copy and past the following into a new module.


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


Call it as follows from the Load event of your pop up/ modal startup form



Call fSetAccessWindow(0)

Ashfaque
01-24-2006, 01:27 AM
:confused: Well, it looks nice but we can not close the image appearing on screen. Only way remains to restart pc.

And even by holding shift key while opening the db, we can't get in to see the db window.

Second thing, if we dont see the access db window, how can we run other forms in the same db?

There must be some way..Whats that ?

With kind regards,

Ashfaque

alastair69
01-24-2006, 01:39 AM
ASHFAQUE,
You can close the database by clicking on the indicator "X", To look at the programing behind the database hold shift down and double click on the database.

Hope this helps you.
Alastair

Ashfaque
01-24-2006, 02:37 AM
Thanks alastair69,

I can play with it now...

Regards,

Ashfaque

popeye
02-03-2006, 10:04 AM
Thanks a million

I added your little baby to several of my forms and immediately the whole thing looks like its just been given a birth into the world of my other programs. I mean seeing my database forms with my desktop behind it instead of the access environment is SWEEET.

Question.

The only hold up i find now is with my reports. The access environment still has to run and open up in order for me to preview them. I checked the report property to add the codes in the on load event but there isnt a load event for reports, do you have a solution to that?
it would be great if i could get my reports to open like the forms; without the access background visible.

___
02-06-2006, 12:53 AM
You can use the snapshot viewer control on a form :)

GRose
02-10-2006, 02:03 AM
Can someone convert it to Access 97 please and then repost it.

Thanks

wazz
02-10-2006, 06:51 AM
haven't tried to open in 97...

Fear Naught
03-10-2006, 08:30 AM
I have tried to load the form but I keep getting the error:

"Background image for form not found."

I assume this is the file car.bmp which I have put into the same directory as the mdb. I even tried chaning the code so that the function call on form load sends the optional path to the function but to no avail.

Help please coz this sounds excellent.

PS. You can close this down without re-booting the PC by going into the processes screen of Task Manager and ending the MSACCESS process.

dazza61
03-12-2006, 08:28 AM
Hi Shadow:-)

Nice code!! - Converted all my forms and used snapshots for my reports (as you suggested though I had to fiddle with the code a lil coz I was using a custom filter routine for my reports)...

Couple of questions though...

Would it be possible to modify the code to hide the access environment so that forms don't have to be set to popup?

My reasoning is that I use e.g. requery within the activate event and popups don't fire the activate event. One of my forms in particular has 20 or so custom timers on which I deactivate the timers when other forms are displayed and reactivate when the form is shown again...

I used to run my app one window open at a time (which would be a workaround to the above as forms are automatically requeried when opened) but sometimes looked messy when switching from large to small forms, etc...

Any ideas would be appreciated.

dazza61

___
03-15-2006, 06:08 AM
I have tried to load the form but I keep getting the error:

"Background image for form not found."

I assume this is the file car.bmp which I have put into the same directory as the mdb. I even tried chaning the code so that the function call on form load sends the optional path to the function but to no avail.

Help please coz this sounds excellent.

PS. You can close this down without re-booting the PC by going into the processes screen of Task Manager and ending the MSACCESS process.

The folder where you put the db needs to have a sub folder called 'Interface' containg the image. So if you put the db in C:\Test\ the image would need to go in c:\Test\Interface\

___
03-15-2006, 06:14 AM
Would it be possible to modify the code to hide the access environment so that forms don't have to be set to popup?
dazza61

Unfortunately, no. :(

I believe this to be the only way to hide the Access environment.