I have a form called frmLoginForm that when the user opens the program it checks to see if he/she is autorized to access it and if so logs their name, date and time to a table. It then opens the form frmMainMenu that gives them access to the database. I want to hide this for from the users view and run behind the scene. I have my code in the Form_Load property. The problem is the for stays visible after it opens the form frmMainMenu. Here is my code, some please give me an idea, I have tried .hide, .visible = false and nothing seems to work.
Dim db As Database
Dim rst As Recordset
Dim strName As String
Dim strSQL As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("tblOCCTeam")
strName = GetCurrentChangeName
If Not rst.EOF Then
Do While Not rst.EOF
If strName = rst!LanID.Value Then
strSQL = "INSERT INTO tblRecStatus(EmployeeName,Status) " & _
"VALUES(" & _
" '" & rst!EmployeeName.Value & " ','" & "Signed On" & "')"
MsgBox "You do not have permission to access this Database, Please contact the OCC Team Supervisor if access is needed."