Joanne said:
This is such a simple app that I have only one form in it - I really
would like to try it so I followed you link and read the code - I
understand some of it ;-)
Biggest problem to getting started is that I don't know where this
code should be located, on Form Load, or Form Open or ........
Couldn't find the answer at the site - do you know where I should put
the function and when/where to call it?
Thanks a heap for you interest and input
Copy the code -- everything between the "*** Code Start ***" and "***
Code End ***" lines -- and paste it into a new standard module (not a
form module). Save that module as "basSetAccessWindow". The actual
name isn't really important, so long as it isn't the name of anything
else in the database.
Now, for the form you want to be showing, make sure the form's PopUp and
Modal properties are set to Yes. Those properties are on the Other tab
of the form's property sheet in design view.
Paste the following into the form's code module:
'----- start of code -----
Private Sub Form_Open(Cancel As Integer)
Me.Visible = True
DoEvents
fSetAccessWindow SW_HIDE
End Sub
'----- end of code -----
If you already have code in the form's Open event, you'll have to modify
that procedure to include the three executable statements in the above
proc.
Make sure that your form has a button on it to close the application
(executing DoCmd.Quit or Application.Quit), or else use the form's Close
event to do that:
'----- start of code -----
Private Sub Form_Close()
Application.Quit acQuitPrompt
End Sub
'----- end of code -----