Hey guys, I have been working on a new database with a few tables. I have built a form that allows the users to enter in the record number that will take them to the proper entry they are wanting to view. I have set this up to open as read only and this creates an issue for me. The users are not able to utilize the navigation. My question is...is there anyway to do open the form with readonly but allow them to type in the navigation field (Go to VLAN Record) to go to the record they are looking for?
Here is an image
Here is my code
Option Compare Database
Option Explicit
Private Sub Command1_Click()
Dim userlevel As Integer
If IsNull(Me.txtLoginID) Then
MsgBox "Please Enter LoginID", vbInformation, "LoginID Required"
Me.txtLoginID.SetFocus
ElseIf IsNull(Me.txtPassword) Then
MsgBox "Please Enter Password", vbInformation, "Password Required"
Me.txtPassword.SetFocus
Else
'process the job
If (IsNull(DLookup("[UserLogin]", "tblUser", "[Userlogin] ='" & Me.txtLoginID.Value & "' And password = '" & Me.txtPassword.Value & "'"))) Then
MsgBox "Incorrect LoginID or Password"
Else
userlevel = DLookup("UserSecurity", "tblUser", "UserLogin = '" & Me.txtLoginID.Value & "'")
DoCmd.Close
If userlevel = 1 Then
'MsgBox "LoginID and Password correct"
DoCmd.OpenForm "P1 Vlan Database Form", acNormal
DoCmd.OpenForm "P2 Vlan Database Form", acNormal
DoCmd.OpenForm "P3 Vlan Database Form", acNormal
DoCmd.OpenForm "BTI Vlans Form", acNormal
Else
DoCmd.OpenForm "P1 Vlan Database Form", DataMode:=acFormReadOnly
DoCmd.OpenForm "P2 Vlan Database Form", DataMode:=acFormReadOnly
DoCmd.OpenForm "P3 Vlan Database Form", DataMode:=acFormReadOnly
DoCmd.OpenForm "BTI Vlans Form", DataMode:=acFormReadOnly
End If
End If
End If
End Sub