MS Access - Importing

Soldato
Joined
8 Oct 2005
Posts
4,184
Location
Midlands, UK
Hi,

I have a simple MS Access database that has a nice an simple Import routine, whereby an excel file is imported when the user clicks import. Would it be possible for me to someway log the path of the excel file that has been imported and record the windows user name that performed the import, in a simple report - E.g.

Date:
File:
User:

Thanks for any help.
 
Doesn't your import routine get the path of the excel file?

As for the windows user name, I have a module to get that information, but I'll post it up later as I have it in a database at work.

As the previous poster mentioned, you're best inserting the information into a table, I can help you on the vba for this if you like.
 
Here's the username Module I have:
Code:
Private Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) _
As Long

Function fncUserName() As String
    
    Dim Buffer As String * 100
    Dim BuffLen As Long
    BuffLen = 100
    GetUserName Buffer, BuffLen
    fncUserName = Left(Buffer, BuffLen - 1)
        
End Function
 
KevinCB said:
Doesn't your import routine get the path of the excel file?

As for the windows user name, I have a module to get that information, but I'll post it up later as I have it in a database at work.

As the previous poster mentioned, you're best inserting the information into a table, I can help you on the vba for this if you like.

That would be excellent, thanks. Hot me up on msn if you want: [email protected]

Thanks!
 
Back
Top Bottom