errors in split database (1 Viewer)

sambucaman

Registered User.
Local time
Today, 01:10
Joined
May 6, 2010
Messages
41
Hi guys. I have a split DB, with the Backend on a NAS drive, and a copy of the front end on 4 PC's in the office.

Everythings works great, or at least did work fine until today, when an unexpcted error has occured.

I use some code to import data, via DoCMDTransfer. Code shown below.

Code:
Private Sub Command17_Click()
MsgBox "You are about to import the photographers work into this database. Please ensure that your data is correct, as this process cannot be undone."
    Dim fDialog As Office.FileDialog
    Dim varFile As Variant
    Dim CustomerFile As String
    Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
    With fDialog
    .AllowMultiSelect = False
    .Title = "Please select your customer file."
    
       .Filters.Clear
       .Filters.add "Excel Spreadsheets", "*.xls"
       'Set the default location to the current user's desktop
       .InitialFileName = "C:\Users\" & CurrentUser & "\Desktop"
       

       If .Show = True Then
             For Each varFile In .SelectedItems
             CustomerFile = varFile
          Next
       End If
    End With

    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, _
    "Customers", CustomerFile, True

    DoCmd.OpenForm "import"
    End Sub

Ok, so this works fine on 3 out of the 4 PC's but on the last one, when we click the import button (Command17 in this case) the browse box opens, and navigates to desktop, but the user is unable to select ANY files. All the folders in this browse box appear empty.

I have run the code above without the following line

Code:
.Filters.add "Excel Spreadsheets", "*.xls"

which on the other 3 PC's lets the user select ANY file. However on PC4, we still cant see any file, only folders, and "empty" folders at that.

So, I'm pretty sure the problems is PC specific, but any ideas what it could be? I have deleted and re-pointed to the backend DB, but no joy.

I'd love any help or feedback. FYI, the OS is 64bit Win7, no hardware changes for months, auto updates are off and no new software has been installed.

Thanks in advance, :)
 

sambucaman

Registered User.
Local time
Today, 01:10
Joined
May 6, 2010
Messages
41
Fixed it myself, by removing the line

.InitialFileName = "C:\Users\" & CurrentUser & "\Desktop"

Thats seems to have done the trick, thanks anyway.
 

Users who are viewing this thread

Top Bottom