Karen,
There's an error in the Form_Activate code I suggested
The line
status = PushFormToBottom (frm.hwnd)
should be replaced by
status = PushFormToBottom (frm)
Set frm = Nothing
Sorry about that
Wayne Pearson
Wayne
Thanks for such an comprehensive solution. I will definitely try this out.
--
Karen
Hi,
If you want to the switchboard to remain visible and below all of the other forms you can do the following
1. Create a module containing the following code
Option Compare Database
Option Explicit
Public Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, _
ByVal hwndInsertAfter As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal wFlags As Long) As Long
Public Const HWND_BOTTOM = 1
Public Const SWP_NOSIZE = &H1
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOACTIVATE = &H10
Public Function PushFormToBottom(ByVal frm As Form) As Long
'Non-zero value indicates success
PushFormToBottom = SetWindowPos( _
frm.hwnd, _
HWND_BOTTOM, _
0, _
0, _
0, _
0, _
SWP_NOSIZE Or _
SWP_NOMOVE Or _
SWP_NOACTIVATE)
End Function
2. Create a Form_Activated event procedure for each form that can be opened from the
Switchboard. The Form_Activated event procedure should contain the following code
Dim frm As Form
Dim status As Long
Set frm = Forms("Put the name of your switchboard here")
'Non-zero status indicates success
status = PushFormToBottom (frm.hwnd)
Wayne Pearson
After choices are made on the switchboard form, I really want it to stay in the background, the bottom form shown while the rest of the database forms are accessed. How can I do that?