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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switchboard - Open Form

Status
Not open for further replies.

imagranny

Technical User
Oct 17, 2002
8
0
0
US
Is there anyway to design a page using the switchboard that the user must enter a password to get to the next switchboard page.

I have a database with multiple tables that are inter-related. The majority of the tables have data that basically the entire department can see. However, I want to design one switchboard page that will take a user to more "confidential" information but I want to limit who can get there. Obviously I realize that a user could unhide the database and get there, but the users here do not have that type of familarity with databases in general.

I realize this could be handled by user levels up front, but I am a field office and the corporate office does not support Access but they own the network. That is why I am looking for a workaround.

I'd appreciate any suggestions.
 
Hi,
I created my own menu form so that I could do exactly what you are talking about. This is actually quite simple. Create an unbound form that is not connected to any data. Add appropriate labels and command buttons to run any program you want.
The code underneath the clicked event of a button might appear as follows:
DoCmd.OpenForm "frmAccountingMenu", , , , acwindownormal

If you wanted to add some special security, you can create another form that is used for passwords (or Login). Along with this, I have a table in the database called UserSecurity, which can be easily hidden. I have some special code that I use to check the user name and password.
Here is that code:
'Open the user_security table
Dim DbInfo As Database
Dim rstSecurity As Recordset
Set DbInfo = CurrentDb()
Set rstSecurity = DbInfo_OpenRecordset("User_security", dbReadOnly)

' Find the record that matches the control.
' the table fields are "User" and "User_initials"
' the user inputs into "temp_initials"
' and "temp_password"
'
rstSecurity.FindFirst "[User] = '" & Me![temp_initials] & " '"
If rstSecurity.NoMatch Then
MsgBox "Invalid login, no such user!", vbOKOnly + vbCritical
DoCmd.Quit acQuitSaveNone
End If

If rstSecurity![user_password] = temp_password Then
'MsgBox "Valid login", vbOKOnly + vbInformation
gstrUser = Me!temp_initials.Value
'DoCmd.Close acForm, Me.NAME
Me.Visible = False
DoCmd.OpenForm "frmAccountingMenu", , , , , acWindowNormal
Else
MsgBox "Invalid password, try again or Quit Application!", vbOKOnly + vbCritical
temp_password.SetFocus
End If
HTH,
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top