Hello Guys, is there any way to allow in my DB upload Documents(pdf, Excell Words Docs) to a local folder and not using the attachment field to avoid DB grow a lot.?
Thankss
Hello Guys, is there any way to allow in my DB upload Documents(pdf, Excell Words Docs) to a local folder and not using the attachment field to avoid DB grow a lot.?
Thankss
You probably want them stored in a central network location, where any user can get to them.
You can move files around using VBA, create and delete folders, and you can list files in folders to list boxes etc. to allow them to be opened.
It really depends on your actual needs and business processes as to which method would work best.
DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
Please use the star below the post to say thanks if we have helped !
↓↓ It's down here ↓↓
Found via Google search--I have adjusted and tried the code.
NOTE: You need a reference to the scripting runtime
Code:'--------------------------------------------------------------------------------------- ' Procedure : TryIt ' Author : mellon ' Date : 19-Jan-2018 ' Purpose : Using msAccess FileSystemObject to move or copy Files from a folder to another '--------------------------------------------------------------------------------------- ' Sub TryIt() Dim FSO As Object Dim FromPath As String Dim ToPath As String Dim FileInFromFolder As Object 10 On Error GoTo TryIt_Error 20 FromPath = "C:\users\mellon\documents\" 30 ToPath = "C:\users\mellon\downloads\" 40 Set FSO = CreateObject("scripting.filesystemobject") 50 For Each FileInFromFolder In FSO.GetFolder(FromPath).files 60 If Right(FileInFromFolder.name, 3) = "png" Then 70 'Debug.Print FileInFromFolder.name 80 FileInFromFolder.Copy ToPath 'use .move to move the file 90 End If 100 Next FileInFromFolder TryIt_Exit: 110 Exit Sub TryIt_Error: 120 MsgBox "Error " & err.number & " in line " & Erl & " (" & err.Description & ") in procedure TryIt of Module AWF_Related" 130 Resume TryIt_Exit End Sub
Thanks For the solutions but do not do what I need, actually could better if when I click in a field this ask for file location and just paste in this field the path to the file, so later user can open the file clicking on the link
Sure, if you convert the sub to a function with appropriate parameters, it can be done.
Often advisable to describe what you are trying to do in plain English --no jargon and no database --
and give an example showing before and after(expected result).
Please describe your need with an example, and I'll convert to a function.
First sorry for my English, I am Spanish speaker.Sure, if you convert the sub to a function with appropriate parameters, it can be done.
Often advisable to describe what you are trying to do in plain English --no jargon and no database --
and give an example showing before and after(expected result).
Please describe your need with an example, and I'll convert to a function.
that I need is simple 1 field that hold the path to a folder or file, each user will save documents in different folders , so when I click in this field access must ask for FOLDER OR FILE PATH, and a option to be able to open this files
thanks
christ2000,
Since English is not your native language, I suggest you use google translate. Write a clear detailed description of what you need in Spanish, then translate that to English. Google translate is very adequate to communicate on this forum.
You want file or all files in a folder?
If you only want to open a file from a folder, you should look at the FileDialog object.
My original understanding of your need was to move fileA from folderX to folderY via Access.
Now, I am not clear on exactly what you want to achieve.
Perhaps you should create an example showing before and after situation.
Google translate's version
Como el inglés no es su lengua materna, le sugiero que use google translate. Escriba una descripción clara y detallada de lo que necesita en español, luego traduzca eso al inglés. Google translate es muy adecuado para comunicarse en este foro.
¿Quieres un archivo o todos los archivos en una carpeta?
Si solo desea abrir un archivo desde una carpeta, debe mirar el objeto FileDialog.
Mi comprensión original de su necesidad fue mover el archivo A de la carpeta X a la carpeta Y a través de Access.
Ahora, no tengo claro qué es exactamente lo que quieres lograr.
Tal vez deberías crear un ejemplo que muestre la situación antes y después.
Ok, my first idea was to upload and save it to a folder and not access, but now I just need that when the user click on a field is ask for the path to the file and this path is saved in this field,
now I have this code, but I don't know how storage the path on the field:
Code:Private Sub lblFolder_Click() Dim f As Object Dim strFile As String Dim strFolder As String Dim varItem As Variant Set f = Application.FileDialog(3) f.AllowMultiSelect = True If f.Show Then For Each varItem In f.SelectedItems strFile = Dir(varItem) strFolder = Left(varItem, Len(varItem) - Len(strFile)) MsgBox "Folder: " & strFolder & vbCrLf & _ "File: " & strFile Next End If Set f = Nothing End Sub
Last edited by orange; 01-19-2018 at 11:39 AM. Reason: added code tags and indent