I'm having a rather interesting problem with my database. I have the DB split into a front and back end, and I have the front end locked down so the casual user can't twiddle with its innards. They open it, enable macros, and they can sail as they please from there. I haven't had a problem before with my users being unable to run VBA, but I added a new tool which uses the code below and suddenly this is the ONLY code that won't run. If I open the frontend as a quote unquote 'super user' (A.K.A. hold shift) then enable macros it runs fine, but when it's locked down it doesn't work.
Does anyone have an idea as to why this might be happening?





Sub loadmesomestudents()
'''GetDataFromClosedWorkbook'''
Dim wb As Workbook
Dim db As Database, rec As Recordset

Dim strSSN As String, strName As String, strRank As String, strTNGSTAT As String
Dim A As String, B As String, C As String
Dim strSearch As String
Dim intSSNExist
Dim intSSNNoExist


intSSNExist = 0
intSSNNoExist = 0
A = "A" & 1
B = "B" & 1
C = "C" & 1
D = "D" & 1
If IsNull(Forms![stuaddbyclass]![ClassPicker]) Then
MsgBox ("Pick a class to put these students into please.")
Exit Sub
Else
Set db = CurrentDb
Set rs = db.OpenRecordset("student roster", dbOpenDynaset)
Set wb = Workbooks.Open("REALPATHMODIFIEDTOPROTECTTHEINNOCENT", True, True)
' open the source workbook, read only
Do Until wb.Worksheets("IMPORT").Range(A).Formula = vbNullString
'''the previous line denotes the end of the working area in the excel doc
strSSN = wb.Worksheets("IMPORT").Range(D).Formula
'''search and find dupe ssn'''
If IsNull(DLookup("[student key]", "[student roster]", "[SSN]= '" & strSSN & "'")) Then

'''the following lines set the variables used on the excel doc

strName = wb.Worksheets("IMPORT").Range(A).Formula
strRank = wb.Worksheets("IMPORT").Range(B).Formula
strTNGSTAT = wb.Worksheets("IMPORT").Range(C).Formula





'''this stuff adds the fields'''
rs.AddNew
rs.Fields("SSN") = strSSN
rs.Fields("student name") = strName
rs.Fields("rank") = strRank
rs.Fields("studenttrainingstatus lock") = strTNGSTAT
rs.Fields("studentacademicstatus lock") = "1"
rs.Fields("currentclasslock") = Forms![stuaddbyclass]![ClassPicker]
rs.Update
intSSNNoExist = intSSNNoExist + 1
i = i + 1
A = "A" & i
B = "B" & i
C = "C" & i
D = "D" & i


Else
intSSNExist = intSSNExist + 1
i = i + 1
A = "A" & i
B = "B" & i
C = "C" & i
D = "D" & i

End If



Loop
If intSSNExist = 1 Then
MsgBox ("Wow, you had a total of " & intSSNExist & " person not added to the database because their social already existed.")
ElseIf intSSNExist > 1 Then
MsgBox ("Wow, you had a total of " & intSSNExist & " people not added to the database because their social already existed.")
End If
wb.Close False ' close the source workbook without saving any changes
Set wb = Nothing ' free memory
rs.Close


End If
'''If intSSNNoExist > 0 Then
'''MsgBox ("You did add some new students, please be patient while I spend some time quietly sorting and creating information in my cave of wonders. It could take a couple minutes, but hey, you can spend this time doing something else you've always wanted to do.")
'''With DoCmd
'''.SetWarnings = False
'''.OpenQuery ("stuappend")
'''.OpenQuery ("stuappend2")
'''.OpenQuery ("stuappend3")
'''.OpenQuery ("stutestappend")
'''.SetWarnings = True
'''MsgBox ("Ok, I should be done now. Thanks a lot! If your students don't have tests visible on their classes grade page... go find a superuser.")
End If
End Sub