Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maximize Form - On Click Event 1

Status
Not open for further replies.

BvCF

MIS
Nov 11, 2006
92
0
0
What is the preferred method to maximize a form - On Click Event?

Currently, when the end user enters their username and password, the form is very small and should be maximized.

The line "DoCmd.RunCommand acCmdAppMaximize" doesn't appear to work.

Displayed below is the code.


Private Sub cmdLogin_Click()
'************************ login sequence
'On Error GoTo local_err
DoCmd.RunCommand acCmdSaveRecord
'
GBL_Access_Level = "X"
GBL_Access_Level = Nz(DLookup("Access_Level", "L_Employees", "Username='" & Nz(Me.UserName, " ") & "' and password='" & Nz(Me.Password, " ") & "'"), "X")
'
If GBL_Access_Level = "X" Then
MsgBox "Invalid Username or Password... try again."
Exit Sub
End If
'
GBL_Employee_ID = Nz(DLookup("Employee_ID", "Employees", "Username='" & Nz(Me.UserName, " ") & "' and password='" & Nz(Me.Password, " ") & "'"), "X")
'
Me.TabCtl0.Pages.Item(0).Caption = "Welcome " & Nz(DLookup("Username", "Employees", "Employee_ID=" & get_global("Employee_ID")), "Invalid Login")

'frmTabbed.Requery 'commented out
'
' call subroutine to set access to forms
'
Call set_privs
'
Forms!frmTabbed.Requery
Me.UserName = ""
Me.Password = ""
Me.TabCtl0.Pages.Item(2).SetFocus

DoCmd.RunCommand acCmdAppMaximize ' Just Added
Exit Sub
End Sub
 
How are ya BvCF . . .

You can't maximize a [blue]popup form[/blue], espcially if its [blue]Border Style[/blue] property is not set to [blue]Sizable[/blue] . . .

Try fixing the [blue]Border Style[/blue] first and see if that does it . . .

Calvin.gif
See Ya! . . . . . .
 
Set the border style to sizable and the size of the form is the same.
 
. . . Try [blue]docmd.Maximize[/blue] instead . ..

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top