Not sure I understand, but here is my best guess.
There are no comments in the code, so this is air code.
The first two lines of every module should be these two lines:
Code:
Option Compare Database
Option Explicit
So here is the code... Warning: AIR CODE
Code:
Public Function ImportUserResponsibilities() As Boolean
On Error GoTo ErrorHandler
Dim FileName As String
' Dim ImportReportName As String 'see below ***
'What is this?
SetFolders
FileName = ReportFolder & "UserResponsibilities.csv"
If FileName = "" Then
ImportUserResponsibilities = False
Exit Function
End If
'clear table
CurrentDb.Execute "DELETE * FROM tblUserResponsibilities"
DoEvents
'set status bar message
SysCmd acSysCmdSetStatus, "Importing UserResponsibilities..."
'set warnings is not needed
' DoCmd.SetWarnings False
DoCmd.TransferText acImportDelim, "UserResponsibilities", "tblUserResponsibilities", FileName, True
'update date/time of import
'*** since the report name is hard coded, no need for the variable
' ImportReportName = "UserResponsibilities"
UpdateImportReportDates "UserResponsibilities"
' DoCmd.SetWarnings True
'clear status bar message
SysCmd acSysCmdClearStatus
ImportUserResponsibilities = True
' Exit Function
ExitDoor:
' DoCmd.SetWarnings True
'clear status bar message
SysCmd acSysCmdClearStatus
Exit Function
ErrorHandler:
MsgBox Err.Description, vbCritical
ImportUserResponsibilities = False
Resume ExitDoor
End Function
'------------------------
Public Sub UpdateImportReportDates(strReportName As String)
CurrentDb.Execute "Update tblReportImportDates SET [ImportDate] = NOW() WHERE [ReportName] = '" & strReportName & "'"
End Sub