If anyone could help me with this, in 2007, I would really
appreciate it.
JackonLI
You can kind of do this, but the results caused so many restrictions and
problems in coding an use of forms, that I really don't recommend this.
You most certainly can, and should hide all of the ms-access interface. The
options to complete hide and keep people out of the ms-access interface can
easily be done using the tools->start-up options. Using those options allows
you to complete hide the ms-access interface (tool bars, database window
etc). Also, using these options means you do not have to bother setting up
security.
Try downloading and running the 3rd example at my following web site that
shows a hidden ms-access interface, and NO CODE is required to do
this....but just some settings in the start-up.
Check out:
http://www.members.shaw.ca/AlbertKallal/msaccess/DownLoad.htm
(there is a 2007 example in the above also)
After you try the application, you can exit, and then re-load the
application, but hold down the shift key to by-pass the start-up options. If
want, you can even disable the shift key by pass. I have a sample mdb file
that will let you "set" the shift key bypass on any application you want.
You can get this at:
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
I think if you also maximize all your forms, then users will never see the
background anyway. The above sample does not use maximized forms...but it
really should, especially now that in 2007 the controls can "grow" when you
re-size the form.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOO...@msn.com
You could check out the API - Manipulate Access Window (code courtesy
of Dev Ashish) which gives you some options to hide and minimize the
main Access Window. See:
http://www.mvps.org/access/api/api0019.htm
I hope this helps. . .
Tony N.
Thanks Tony,
From what the page says this is what I'm looking for. Unfortunately I
have no clue how to implement it. I tried creating a function but
when I pasted the code in, the four "Global Const" items were red.
And I'm not sure how to call a function either.
Thanks again
JackonLI
JackonLI: I have used this code in a couple of Access 2003 and 2007
projects and it has worked well for me. You need to create a module -
Visual Basic => Insert => Module - and then paste in the statements
from Code Start to Code End. After this you should be able call
fSetAccessWindow (for instance from a designated Start Up form) and
invoke the required setting. For example, to minimize Access (so that
it shows as an entry in the Task Bar, and displays the form only) use:
fSetAccessWindow (SW_SHOWMINIMIZED).
Good luck. . .
>On Jun 11, 3:44�pm, JackonLI wrote:
OK. I created the module. I created an Event Procedure with
fSetAccessWindow(SW_HIDE)
and when I run the database the form is hidden but the Access Database
window is there.
I did designate the form as the startup form.
;-(
JackonLI: Hmm. . . I'm not sure how you could create the combination
where the Access window displays and the form is hidden. Have you
tried the SW_SHOWMINIMIZED option? The forms must be Popup and Modal
for this to work. Also, when you do get it working, if you have
reports in the database, you may have to display the Access window for
them to work. My only suggestion is to ensure that the forms are Popup
and Modal and then experiment with the different settings - as I
mentioned in my previous post, it has worked successfully for me
without any additional parameter settings or other coding.
Regards. . .
Tony N.
>
>
>JackonLI: Hmm. . . I'm not sure how you could create the combination
>where the Access window displays and the form is hidden. Have you
>tried the SW_SHOWMINIMIZED option? The forms must be Popup and Modal
>for this to work. Also, when you do get it working, if you have
>reports in the database, you may have to display the Access window for
>them to work. My only suggestion is to ensure that the forms are Popup
>and Modal and then experiment with the different settings - as I
>mentioned in my previous post, it has worked successfully for me
>without any additional parameter settings or other coding.
>
>Regards. . .
>
>Tony N.
I really hate to keep bothering you on this, but I seem to be close.
I created the Module (should this be a class module?) I did the
regular one.
Pasted the code from start to finish,
In the forms "On Open" property I placed
fSetAccessWindow (SW_SHOWMINIMIZED)
I am getting the following error
"Expected Variable or Procedure, Not Module"
I know I'm making some really dumb mistake here, but I am lost.
Jackonli
Jackonli: It sounds like you are having fun! No, it doesn't have to be
a Class Module, but I believe you can get that error message when you
have saved the Module with the same name as the Function. So if you
have named the module fSetAccessWindow, that would probably give you
these symptoms, and the solution would be to rename it to something
other than the Function name e.g. modfSetAccessWindow.
Good luck. . .
Tony N.
OK. I created a new database, 1 table, 1 forn and the Module.
It didn't work the way it is supposed to. I kept getting an error
message that window could not be hidden without a form open.
I also tried calling for On Open and On Load.
I created 2 buttons on the form. One with the call to Hide and the
other with the code to Show. Worked like a charm, but this is very
cumbersome and sort of defeats the purpose.
The name of the module was not the same as the code in either of the
DB's.
The thing that bothers me the most is it seems there are many people
out there that get this to work no problem.
JackonLI
JackonLI: I tried the same combination that you describe - new
database, the fSetAccessWindow module and a form - and when I put
fSetAccessWindow (SW_SHOWMINIMIZED) in the Form Open event, it works
as advertised. I can reproduce your error (i.e. cannot hide without
form on screen etc) if I specify an invalid argument e.g.
(SW_MINIMIZED).
So, I am sort of out of ideas, but my suggestion would be to double
check the fSetAccessWindow parameter, and if that looks OK, search
this and other Access forums for fSetAccessWindow and/or the error
message - maybe there is a conflict with the module code and another
Access specification.
I hope you are able to resolve this. . .
Tony N.
>On Jun 12, 1:37�pm, JackonLI wrote:
Just an update. I always copied and pasted from the module.
Anyway, I have been trying to get the window to "hide" all this time.
I then decided to try the SW_SHOWMINIMIZED, and guess what.
Yes indeed. It worked. It's not perfect since it shows in the
taskbar, but it clears the screen except for the form.
I'm just curious why the SW_HIDE doesn't work. I will do as you
suggested, and search fSetAccessWindow on the Internet.
Thank you so much for your patients, and ALL of you help.
JackonLI
JackonLI: I'm pleased to hear you have arrived at a workable solution.
I went back and retried the test database using SW_HIDE instead of
SW_SHOWMINIMIZED and I get the same error that you reported (cannot
hide etc.) - I don't know why it acts in this way. My preference is to
minimize rather than hide completely. If you hide completely and you
have several applications open, the only way to return to the Access
database is using ALT+TAB to display and select active programs. But
if you minimize, it acts like any other application and you can
redisplay it by clicking on the Task Bar entry.
Anyway, congratulations on persevering - ain't Access wonderful!!
Tony N.
>On Jun 12, 6:31�pm, JackonLI wrote:
Well, it took a bit of searching for " fSetAccessWindow" as you
suggested but I finally found what I needed.
Both Popup and Modal need to be Yes.
And the following code gets pasted into the forms "On Load"
Private Sub Form_Load()
Me.Visible = True
DoEvents
Call fSetAccessWindow(SW_HIDE)
End Sub
Thanks again for all your help
JackonLI
Right, but if you maximize your form, then you not see that background.
I mean all of office for about 15 years now when you use excel, word and
most of office did have a background window (so, it not like you going scare
someone).
However, just maximize your forms, and you not need nor see the
background...
In 2007, you can also choose to use the tabbed interface, and again you not
see the background window when you do this...