Hi everyone,
I am using a module that holds logon on data for later use. I then added some code that is supposed to capture the User.UserID from the module and compare it to field in tblEmployees named A_UserID. The result will be the form will only show the records for the person logged into the database.
I tried moving the code from the OnLoad to the OnOpen event but that did not work either.
For the life of me, I cannot get the User.UserID value to populate. Can anyone suggest what I am doing wrong?
Thanks
Dom
I am using a module that holds logon on data for later use. I then added some code that is supposed to capture the User.UserID from the module and compare it to field in tblEmployees named A_UserID. The result will be the form will only show the records for the person logged into the database.
I tried moving the code from the OnLoad to the OnOpen event but that did not work either.
For the life of me, I cannot get the User.UserID value to populate. Can anyone suggest what I am doing wrong?
Thanks
Dom
Code:
Option Compare Database
Option Explicit
'----------------------------------------
' This code is used assign variables to the user
'information and hold it in memory
' so that it can be used as the user navigates through
' the database
' Created By: Richard Rensel
' Created On: 19 Feb 2002
' Modified On: 19 Feb 2002
'----------------------------------------
Public Type UserInfo
ViewID As Integer
AccessID As Integer
Active As Boolean
Password As String
UserID As String
SecurityID As String
End Type
Public User As UserInfo
[COLOR=red]************************************[/color]
Private Sub Form_Load()
Call myHideBars
[b]DoCmd.ApplyFilter "", ([A_UserID] = User.UserID)[/b]
If Me.Recordset.RecordCount = 0 Then
MsgBox "No Records To Display"
Me.Undo
Me.FilterOn = False
End If
End Sub