Issue with file picker after splitting DB

utzja1

Registered User.
Local time
Today, 09:02
Joined
Oct 18, 2012
Messages
97
I created a form for a database that included a textbox with an event handler (on_click). When the user clicks in the field on the form, it launches the Windows file select dialog box. When the user makes their selection, that value is stored in the database as the path to the target photo.

I recently split the database and distributed the front end. When the database was "whole" on the on the network, the file selector worked perfectly when I tested it. I gave it to another employee in my office and when I went to demonstrate the file picker, he got an error message that said he could not modify this field. I then went back to my desk, and when I tried to modify, I did not get the error message but field value remained blank. The message box confirmation shows that the module is grabbing the file path, but is not modifying the field.

I have included the code, but if someone more learned than me thinks its a folder permission issue, then let me know. I may need to check to make sure that everyone has read/write permissions on the folder. Thanks for your consideration!


Private Sub Photo_Click()

Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant

With fd
.AllowMultiSelect = False
.Title = "Browse to Select a File"
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
MsgBox "Selected item's path: " & vrtSelectedItem
PhotoPath = vrtSelectedItem
Next
End If
End With

Set fd = Nothing

End Sub
 
Me.PhotoPath.Value = vrtSelectedItem
 
Thanks, I will give it a shot. The root cause may be the permission on the folder, as I discovered today that the folder where the back end resides is tagged read-only. But if I can improve my syntax in the process, I will certainly do it. Thanks!
 
Thanks, I will give it a shot. The root cause may be the permission on the folder, as I discovered today that the folder where the back end resides is tagged read-only. But if I can improve my syntax in the process, I will certainly do it. Thanks!

you can't use a database with readonly access to the backend folder. It isn't just the data - you need to be able to amend the .laccdb/.ldb file. (although possibly that's a windows thing, rather than an app thing)
 

Users who are viewing this thread

Back
Top Bottom