Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Show a Excel UserForm in Access


Hello Mark,

This code will keep your UserForm on top of all other forms. Add a VB
Module to your project and copy the code below into it.

CALLING THE MACRO
In the UserForm Activate event code module insert the following...
KeepFormOnTop


Code
-------------------

Private Declare Function SetWindowPos _
Lib "user32.dll" _
(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

'Returns the Window Handle of the Active Window
Public Declare Function GetActiveWindow _
Lib "user32.dll" () As Long

Public Sub KeepFormOnTop()

Dim hWnd As Long

Const HWND_NOTOPMOST = -2
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1

hWnd = GetActiveWindow()

SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 0, 0, _
SWP_NOMOVE + SWP_NOSIZE

End Sub

-------------------


Sincerely,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=49561

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Show a Excel UserForm in Access

Hi Leith,

Thanks very much for your help. That is exactly what I want to know.
Have a great holiday.

Mark

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform access on multiple excel files?? kewlrunnings Excel Programming 1 October 8th 05 12:21 PM
why do word documents show up on excel and access file menu? LJH Excel Discussion (Misc queries) 1 February 26th 05 11:47 AM
Access from add_in userform to main template userform.... Ajit Excel Programming 1 November 18th 04 05:15 PM
VB UserForm to MS Access bsullins[_6_] Excel Programming 0 October 13th 04 11:20 PM
How to show a userform using excel macro in multipage Solomon B Excel Programming 1 April 27th 04 03:32 PM


All times are GMT +1. The time now is 11:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"