DRAG & DROP Tutorial in Ms Access
ฝัง
- เผยแพร่เมื่อ 21 ก.ค. 2024
- Learn how to implement Drag and Drop functionality in VBA with our quick and easy tutorial!
Discover step-by-step instructions and practical examples to enhance your userform projects.
Time Stamp:
00:38 Create Table
02:36 Insert Picture
03:24 Get the Filename
Other Related Videos
Len Function: • How to use LEN FUNCTIO...
Hyperlink Tutorial: • How to open External F...
KEYWORDS
VBA drag and drop tutorial
VBA drag and drop
VBA userform drag and drop
Drag and drop in VBA userform
VBA drag and drop files
VBA drag and drop listbox
VBA drag and drop example code
VBA drag and drop multiple objects
#microsoftaccess
#microsoftaccesstutorial
#mstutorial
solid ka sir edcelle maramimg salamat sa mga tuts mo..
Maraming salamat sa panonood sir.
sir Ed thank you for tutorial God bless more tutorial po 🙏 multiple file naman po sir 😊
Salamat sa idea.
Good day
Thanks for the tutorial, it helped me a lot,👍
but I have a question: is it possible to make it so that you can also add and display PDF files?
Thank you 😊😊😊
Welcome 😊
Sir I try to make the browse button to copy past in folder but can't get it to work as a hyperlink. when you drop n drag you can click on the kink and it opens the picture. with the button it does not. can you show us how you did your form to work? wish to learn and this is a nice tool to have in case of use in the future.
I will upload soon my demo file.
You are awsome. Thanks
@@EdcelleJohnGulfan
Hi Sir,
How to set Serial number ms access Form
How to do this for excel files, in order to update a subform with the dropped excel file?
You need to have another button for import excel
Using what you have done. How do you limit the file type to certain file extensions that would be stored in the database. Example. GIF, JPG, JPEG, PNG, SVG, WebP. I did it in HTML I just remember it being a pain, and hoping it's easier with VBA and Access.
Nice question. I'll create a part 2 of this tutorial and that would be the topic.
@@EdcelleJohnGulfan I at one time did this in HTML for a Website I did. I'm too lazy to go through my code however - and I'd assume the method would be similar, but maybe easier.
Sr. Edcelle Gulfan muito obrigado pelo tutorial do exemplo Drag And Drop de imagens... vai ser muito util no meu projeto em MSAccess, excelente. Uma questao Sr. Gulfan... como fazer pra arrastar a imagem na propria imagem e nao no campo Hyperlink_In? Aguardo um retorno, Parabens e obrigado!
Put it as overlapping.
@@EdcelleJohnGulfan Entao, sobre posto a imagem Eu ja fiz, mas esconde a imagem Gulfan
I HATE hyperlink fields... kind of. The hyperlink_in works fine with my C:\, D:\, E:\, but won't work with my F:\. That drive has a folder that is shared. Doesn't matter what folder I pull it from the file is always ..\foldername\file.jpg. After update launches and viola no file copied to the NewPath location. Dumber part is if I click on the hyperlink the default program will open. If I network share the whole drive and access through the SharedDrive then it works fine. The issue is annoying to say the least.... but I found a work around.
In every problem, there's always a solution.👍
I have the same problem: I dont see full path, I dont know why. Can you please explain how did you solve the problem, thanks
@@iljak2914 I got past the problem with my F: drive (that is the drive location that refuses to show correctly) by not calling for files from that drive but instead selected the files from the Network Mapped drive (In my case N:) If you don't have a shared folder than my work around fails. But I still hate hyperlink fields. Example of why. Try to edit a hyperlink field. It's not easy to do.
I STILL HATE hyperlinks. My Access database that I had the drag and drop sample on it got corrupted and the only working backup didn't have this form in it. So back I went to this video. Reproduced the form - Oh I had some Windows issues at one point as well. It would work fine with C:\, D:\, E:\ and for some reason the F:\ which is still mapped. as P: and N:. For awhile it didn't want to work ---- now it does. And it was right after I read that After a user inserts a hyperlink to a file residing on a network mapped drive within an Office product, the hyperlink's text displays the network mapped drive path, however the link is resolved as the UNC path instead of the Network mapped drive path. It would look correct but Access can't find the file. There is per Microsoft no resolution for this and recommends the user insert hyperlinks using the UNC path. Then what happens the Access form displays correctly.
I placed my images folder in the same directory current project. Changed the Control Source for the DragNDropImg to =[CurrentProject].[path] & "\Images\" & [HyperlinkOut]. This if I move the project to a different file location/drive I'm not redoing a ton of coding. On the HyperlinkIn after update code I have the Newpath set as NewPath = Application.CurrentProject.Path & "\Images\" and then after I copy the file from it's original location to the Image folder I run the following line: HyperlinkOut = Right(HyperlinkOut, Len(HyperlinkOut) - InStrRev(HyperlinkOut, "\")) This trims it down to the file name only.
easyly but great....
Thanks for watching
i have a db file in fifa patch and i want open it in SQLCipher but i can't because password so how can i broke down this password
You need to have the sql credentials.
@@EdcelleJohnGulfan
Can you send me a video explaining how to do this? and how can i connect with you ?
Hi, can you please show how to add to list box multiple file to multiple columns, like file name, file url, file type separately, using file dialogue
Here is the code I have,
Private Sub cmdFileDialog_Click()
'Requires reference to Microsoft Office 12.0 Object Library.
Dim fDialog As Object
Dim varFile As Variant
Dim FileURL As String
Dim FileName As String
Dim FileType As String
'Clear listbox contents.
Me.FileList.RowSource = ""
'Set up the File Dialog.
Set fDialog = Application.FileDialog(3)
With fDialog
'Allow user to make multiple selections in dialog box.
.AllowMultiSelect = True
'Set the title of the dialog box.
.Title = "Please select one or more files"
'Clear out the current filters, and add our own.
.Filters.Clear
.Filters.Add "Access Databases", "*.MDB; *.ACCDB"
.Filters.Add "Access Projects", "*.ADP"
.Filters.Add "All Files", "*.*"
'Show the dialog box. If the .Show method returns True, the
'user picked at least one file. If the .Show method returns
'False, the user clicked Cancel.
If .Show = True Then
'Loop through each file selected and add it to the list box.
For Each varFile In .SelectedItems
FileURL = varFile
FileName = Mid(FileURL, InStrRev(FileURL, "\") + 1, InStrRev(FileURL, ".") - InStrRev(FileURL, "\") - 1)
FileType = Right$(FileURL, Len(FileURL) - InStrRev(FileURL, "."))
Me.FileList.AddItem FileName
'Me.FileList.Column(1).AddItem FileURL
'Me.FileList.Column(2).AddItem FileName
'Me.FileList.Column(3).AddItem FileType
Next
Else
MsgBox "You clicked Cancel in the file dialog box."
End If
End With
End Sub
Yes sure soon.
By the way, thanks for watching.
Can I hire you if I have some access things I want to achieve? Fx access a website mysql and create a folder on my drive based on a value in a column?
Yes if i have available time. Email me at eduardogulfan@gmail.com
Ed this is beautifully explained. Can we also attach PDF and Word, Excel files?.
Yes we can but it won't display same as the picture.
@@EdcelleJohnGulfan Your an Amazing Programmer.
You could have used Replace() instead of Right() and InStrRev().
Thanks for the suggestion. Have you tried?
@@EdcelleJohnGulfan yes. I did .
Frist i want to thank you for good wok
Second i have question i have form to show pic from his path i want to make thing can show pic or pdf in the same form
Nice idea. I'll create a video soon.
@@EdcelleJohnGulfan
Thank you for your quick response, but I would like to explain the whole idea to you. I want the form to display the image, then when moving to a line containing a PDF file, it hides the image through which it is displayed, and a PDF viewer appears. Thus, switching between the image viewer and the PDF viewer is done according to the type.
1 view
1st runner up😃😃😃
Thanks for watching