I've produced an Access application that reads the users login name from their environmental settings and then acquires their full name and department from the "Startup" table, to display on their startup screen (Code shown below).
While this works satisfactorily in Access 2002 on any windows platform, it falls down on Access 2003.
When debugging I get [Run-Time Error "2001" You cancelled previous operation], and have no idea why.
The line Marked "***" is where the debugger pulls up the error (Admin Edit - Line #13).
Any pointers would be greatfully recieved.
Thanks
Phil
--------------------------------------------------
Expand|Select|Wrap|Line Numbers
- Public Sub Form_Load()
- Dim RSstr As String
- Dim Uname As String
- Dim Udept As String
- Dim Utitle As String
- Dim N_Name As String
- Dim Slevel As Integer
- N_Name = Environ("Username")
- ** If IsNull(DLookup("[Users_Name]", "Startup", "[Network_Name] = N_name")) Then
- Uname = "Operator"
- Udept = "Unknown"
- Utitle = "Unknown"
- Slevel = 5
- Else
- RSstr = "SELECT * FROM Startup Where [Network_Name] = " & "'" & N_Name & "'"
- Me.RecordSource = RSstr
- Uname = [Users_Name]
- Udept = [Dept]
- Utitle = [Job_Title]
- Slevel = [Sec_Level]
- NTstr = Uname & " - " & Utitle
- End If
- End Sub