Results 1 to 15 of 15
  1. #1
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    59

    Unhappy is there an easy way to link pdfs, mails to mdb ??? "drag and drop"?

    my "accounting"-feature is now running as it should thank you so much!!!! :-)


    so I started to find an easy way to store and find "papers" again which come in by mail or letter
    so far I have organized the archive of these documents in several folders and many subfolders and it takes some time in Access to link them one by one ...

    I'm a bit "spoiled" from my former programme at work, where you could simply drag and drop whatever you wanted directly into the programme and decide there where it belongs to within the Programme-archive (it could also divide long pdfs pagewise into different documents!!!) and want something most similar for the future ...

    If I found a way to find documents again in my access-mdb I wouldnt have to store them in different subfolders on my pc, and would just create one "Links"-folder

    is there any - simple - way in access?
    to either drag+drop or create the links automatically (might be difficult with mails which all have the same Headline to one topic..)

    or is there any programme on sale which works with access and would do that for me?

    as always - sorry - I don't quite know the correct words for my problem, thus my google-search lead me to nowhere...
    so any hint will help me! THANK YOU

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    8,558
    AFAIK, there is still no drag and drop feature that works with Access.
    Would iterating over all the files in a folder and then appending their complete file path to a table do what you want? You'd have to choose the folder to start. If there are subfolders, the procedure has to be recursive. So maybe your search term could be "ms access iterate over all files in folder and subfolders".
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  3. #3
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    59
    Quote Originally Posted by Micron View Post
    AFAIK, there is still no drag and drop feature that works with Access.
    Would iterating over all the files in a folder and then appending their complete file path to a table do what you want? You'd have to choose the folder to start. If there are subfolders, the procedure has to be recursive. So maybe your search term could be "ms access iterate over all files in folder and subfolders".
    thank you for telling me, what I should search... it took me some hours and about 1000 failures, but I finally made it, it works, with all file-extensions :-)
    hope the codetags now also do what I'm exspecting them to do...

    Code:
    Private Sub TEST_DblClick(Cancel As Integer)
    Dim pfad As String
    Dim name As String
    Dim hyp As String
    
    pfad = "C:\AAA\"
    name = Dir("C:\AAA\*.*")
    
    While name <> vbNullString
    hyp = "#" & pfad & name
    
    Dim db As Database
    Dim rs As Recordset
    Set db = CurrentDb
    Set rs = db.OpenRecordset("Hyperlinks")
    rs.AddNew
    rs!Link = hyp
    rs.Update
    rs.Close
    db.Close
         
    name = Dir()
    Wend
    End Sub
    the next question will probably be, how I can transfer the files automatically from one directory (AAA to be inserted to Access) to another directory (BBB already inserted into Access) ... otherwise I'd insert the same files again and again if I forget to shift them by hand ... so far I think it is no problem to "rename" the path right away to BBB , but it will take me another night to make the code shift them really to the BBB ..

    by the way: so far I only know one way to start a code : create a form with a button to cklick on and write the code in the properties
    is there an easier method? (so I alwas have to shift between formview and draft view)

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    2,248
    Use the Name statement to move each file from AAA to BBB immediately after you add the record to the table.
    https://docs.microsoft.com/en-us/off...name-statement

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    8,558
    I don't know what your second to last paragraph means. Sounds like you're saying you want to put the files into an Access table as attachments - not a good idea because you will soon arrive at the size limit for your db. Or you are saying you want VBA to move the files from one directory to another; can't tell which. "ms access move files from one folder to another" should guide you for the latter but consider whether or not to be concerned about over-writing files with the same name if that is a possibility.

    One way to call code from other than a form is a macro. You could name it similar to the procedure but don't use the same name. Or you can call code from the immediate window. Speaking of "name" it is a bad choice for an object name. Might work today, might break in the future as Access updates tend to make some marginal things to stop working. See http://www.allenbrowne.com/AppIssueBadWord.html
    Likely you will NEVER use a reserved word if you adopt a proper and useful naming convention. Not only would a variable named strName never tread on a reserved word, the use of str types the variable and you will never wonder what the variable should be holding when you get down into the 100th line of code - especially 6 months from now.
    See
    http://access.mvps.org/access/general/gen0012.htm
    https://www.access-programmers.co.uk...d.php?t=225837
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  6. #6
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    59

    Smile

    Quote Originally Posted by Gicu View Post
    Use the Name statement to move each file from AAA to BBB immediately after you add the record to the table.
    https://docs.microsoft.com/en-us/off...name-statement

    Cheers,
    thank you so much Gicu! took me another two hours, to find out, where in the code the "rename" should take place and I changed "name as string" to "datname as string" to avoid confusion with the name for the "rename"
    but now it does excatly what I want! makes hyperlinks in my Access-Table from all files in folder AAA , already with the link to the new destination of folder BBB and then moves the files there :-)

    Code:
    Private Sub TEST_DblClick(Cancel As Integer)
    Dim pfad As String
    Dim datname As String
    Dim hyp As String
    Dim alt As String
    Dim neu As String
    
    pfad = "C:\AAA\"
    datname = Dir("C:\AAA\*.*")
    
    While datname <> vbNullString
    Dim newpfad As String
    newpfad = "C:\BBB\"                      'new destination
    hyp = "#" & newpfad & datname
    
    Dim db As Database
    Dim rs As Recordset
    Set db = CurrentDb
    Set rs = db.OpenRecordset("Hyperlinks")
    rs.AddNew
    rs!Link = hyp
    rs.Update
    rs.Close
    db.Close
    alt = pfad & datname
    neu = "C:\BBB\" & datname
    Name alt As neu
    
    datname = Dir()
    Wend
    End Sub
    I'm so happy now, and hope I can clean up my desk from all the papers waiting to be stored (... in a way to find them again :-) )
    and think I will also be able to adapt that code somehow to use it for a single file too somewhere else in my mdb :-)

  7. #7
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    59
    THANK YOU MICRON!!! I didn't know that "name" was a reserved word and I now renamed the "name" variable to "datname" but now it works:-)
    I'll try to find out next if it really simply "overwrites" files with the same name .. usually if I wan't to rename something directly in the directory in that way, it wouldn"t let me, rsp. asks me if I really want to replace the old file with that name, and when I try to copy a file to a directory where it already exists it asks "replace or keep both" ...

    It is so kind of you to always give me links to the basics of access-programming but as I've just retired, I really don't want to start a new education and career, just want to use access to do monthly routines "per one click" for me and store "important" papers/files on the PC so that I can "throw" the real paper-folders down to the basement, and hopefully never have to go there again in the next 22 years (this is how long I have to store the data...) :-) .. I'll rather take my pc with me to "anywhere my camper will take me" :-)

  8. #8
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    8,558
    Between memory lapses and the number of people I engage with here and elsewhere, I might forget that you don't want such links. Just ignore them if I post any that you don't want. Good luck with your project
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  9. #9
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    59

    Smile

    Quote Originally Posted by Micron View Post
    Between memory lapses and the number of people I engage with here and elsewhere, I might forget that you don't want such links. Just ignore them if I post any that you don't want. Good luck with your project
    Thank you Micron! for everything, I dont't mind to get links I don't use, maybe someone else can make use of them! ... I just don't want to occupy your time for posting them for me!

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    8,558
    I have a large set of links in a text document. Between those and what I know of a problem and then find the link for it, it takes hardly any time at all. It tends to be my approach (but I admit, not always) because that's the teacher in me who tries to give back. Plus, I'm not trying to run an Access based business as some are, so I can afford to not spoon feed everybody with things like sample databases that I create. In other words, you're more apt to get direction from me as opposed to a quick and dirty solution - unless the problem is an obvious one, such as incorrect syntax and the like. Sometimes, that's the price you have to pay for free help from me!
    P.S. I'm retired too - how else do you think I find the time to troll here, Mr. Excel and Subaru Outback.org?
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  11. #11
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    59
    Quote Originally Posted by Micron View Post
    I have a large set of links in a text document. Between those and what I know of a problem and then find the link for it, it takes hardly any time at all. It tends to be my approach (but I admit, not always) because that's the teacher in me who tries to give back. Plus, I'm not trying to run an Access based business as some are, so I can afford to not spoon feed everybody with things like sample databases that I create. In other words, you're more apt to get direction from me as opposed to a quick and dirty solution - unless the problem is an obvious one, such as incorrect syntax and the like. Sometimes, that's the price you have to pay for free help from me!
    P.S. I'm retired too - how else do you think I find the time to troll here, Mr. Excel and Subaru Outback.org?
    Great to learn I'm not the only silverneck in here:-) so far I have always thought everybody else is professionally working in programming and while looking for something for themselvse, they just sort of stumble over my stupid questions and are friendly enough to help a beginner to get on...
    I admire and envy you for the skills you have and it's great that you are willing to help others! My plans for my next years are rather, to have as little as possible to do with "desk+pc-work" (I've had that most of my working life).... that's why I'm so desperately working on getting things organized now, before the weather gets warm enough to start off into nature ... so maybe next time (... and most probably there will be a next time...) I'll add "dirty solutions appreciated" in my post

  12. #12
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    8,558
    I'm here because Orange helped me with what I thought was a difficult problem about 6 years ago. Giving back is the name of the game, but there's also a side benefit of keeping and improving one's skills/knowledge by helping others. For a while, it was also because there was a chance I'd get called back to work for a 3rd time but I think that's never going to happen at this stage. This might be my last year for Office 365.
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  13. #13
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    59
    Sounds as if you miss your teacher-job?!? according to what happens - or rather does not take place - in schools at the moment, I guess you have good chances for a third time to be called back ... to me - staying at home - doesn't make much difference to "normal" - used to work at home for the last 20 years:-) but I feel sorry for everybody who would like to go out, and especially for the kids that cannot go to school and "miss" a whole year.. they will need much help to catch up ... and - hopefully - additional teachers will be employed! I keep my fingers crossed for you!

  14. #14
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    8,558
    The only time I was employed as an instructor was in continuing education in basic photography (community college) for about 6 years. My primary job was in heavy equipment/diesel mechanics and equipment reliability. When I completed my last apprenticeship course, the main instructor tried to convince me to apply as a teacher, but I didn't because I figured no one wants to listen to a guy with little practical experience. During my 25 year career in the mechanical field people often commented on my knack for explaining things so I guess it's my nature.

    After 25 years I migrated to quality and environmental systems, then into contracting. It was in contracting that I became the 'go to guy' for Access in my area because of my involvement in quality and environmental databases. All that with the same great employer, so there was little incentive to get into the teaching stream. That's my sad story.
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  15. #15
    brigitteAT is offline Advanced Beginner
    Windows 7 64bit Access 2013 64bit
    Join Date
    Jan 2021
    Posts
    59
    Quote Originally Posted by Micron View Post
    The only time I was employed as an instructor was in continuing education in basic photography (community college) for about 6 years. My primary job was in heavy equipment/diesel mechanics and equipment reliability. When I completed my last apprenticeship course, the main instructor tried to convince me to apply as a teacher, but I didn't because I figured no one wants to listen to a guy with little practical experience. During my 25 year career in the mechanical field people often commented on my knack for explaining things so I guess it's my nature.

    After 25 years I migrated to quality and environmental systems, then into contracting. It was in contracting that I became the 'go to guy' for Access in my area because of my involvement in quality and environmental databases. All that with the same great employer, so there was little incentive to get into the teaching stream. That's my sad story.
    to me that doesn't sound like a sad but a very exciting job-story.. and if you want to carry on, don't be too modest! you have lots of experience in different fields and that you so showed that you are able to adapt to different requirements is a skill, not to be taken for granted! and you have the feedback that you're a good instructor/teacher! so don't you think you have nothing to tell!.. and if you still think "nothing to tell", maybe it helps you to think of the thousands of teenagers who nowadays jam the www and social media telling us "how live works"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Simple table relationships ("faces" to "spaces" to "chairs")
    By skydivetom in forum Database Design
    Replies: 36
    Last Post: 07-20-2019, 01:49 PM
  2. Replies: 8
    Last Post: 09-01-2016, 07:15 PM
  3. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  4. Replies: 2
    Last Post: 04-10-2013, 02:59 PM
  5. Replies: 2
    Last Post: 03-29-2012, 08:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums