This function is supposed to look through all the records in a table to see if the user's username is in the table, but is only looking at the first record.
Public Function CheckUser() as Integer
Dim dbs As Databse
Dim rdsLocker As recordset
Dim rdsDistMaster As recordset
Set dbs = CurrentDb
Set rdsLocker = dbs.OpenRecordset("Select Locker From tblLocker)
Set rdsDistMaster = dbs.OpenRecordset("Select DistMaster from tblDistMaster)
If fOSUserName = rdsLocker("Locker"
THen CheckUSer = 2...
Only the first name in the table is recognized, and I can\t figure out why. Any help would be greatly appreciated.
Thanks
Public Function CheckUser() as Integer
Dim dbs As Databse
Dim rdsLocker As recordset
Dim rdsDistMaster As recordset
Set dbs = CurrentDb
Set rdsLocker = dbs.OpenRecordset("Select Locker From tblLocker)
Set rdsDistMaster = dbs.OpenRecordset("Select DistMaster from tblDistMaster)
If fOSUserName = rdsLocker("Locker"
Only the first name in the table is recognized, and I can\t figure out why. Any help would be greatly appreciated.
Thanks