How to diable main Access window

D

Domac

Hi,

I have a modal login form wich is a startup form.
How to disable main Access window until login form is closed??
When I set popup property to true I get desired result but then my empty
textbox used for Username entry can't get focus when form shows.
So I must aviod using that property, please advise me on alternative method.
But, above mentioned problem is consequence of me "playing" with
SetWindowPos API function that goes like this:

<CODE START>
Public Sub WindowTwipsResize(ByRef frm As Form, Width As Long, Height As
Long)

Dim lngPixWidth As Long
Dim lngPixHeight As Long

lngPixWidth = fTwipsToPixels(Width, DIRECTION_HORIZONTAL)
lngPixHeight = fTwipsToPixels(Height, DIRECTION_VERTICAL)

SetWindowPos frm.hwnd, HWND_TOP, 0, 0, lngPixWidth, lngPixHeight,
SWP_NOMOVE

End Sub
<CODE END>

Did I mess something up with wrong combination of constants?? I simply want
to resize , not moving and no z-ordering.
Goal is to resize form and when form shows to txtUsername get focus.

Please help..
Domagoj
 
B

Bill Mosca, MS Access MVP

I set my startup form border style to Dialog and remove the control box so
it cannot be resized. I also set AutoCenter to Yes.

Making it popup and modal just might be overkill presuming you have code to
prevent entrance unless log in is acceptable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top