Results 1 to 4 of 4
  1. #1
    simonwait is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    3

    Manipulating Images

    Hi

    I am trying to write some VBA code which iterates through a table ("tblPlayers") and specifically looks at two fields (Photo and PhotoNew). The code should look at a folder of images and based on the filename (which should match the names in a field called PlayerName it should add the image into the PhotoNew field for that record before moving on. If a photo isnt found then it is just skipped.

    My issue is that whilst iterating through is easy enough I cant seem to find any documentation for adding and deleting files attached to a field in access via VBA.

    Normally Google is my friend here but not this time and as access doesn't have the lovely macro recorder so i can figure it out that way Im slightly lost. I was trying rs.Fields("PhotoNew"). but then none of the options when i add the next '.' are suitable i think and changing it to something like rs.Fields("Photo").Value = "" (for deleting) returns Item not found in collection.

    Thanks in advance.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    49,515
    Advise not to embed files within db - this uses up Access 2GB size limit.

    Review https://sourcedaddy.com/ms-access/wo...nt-fields.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    simonwait is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    3
    Hi June

    Good to know about that. Thankfully this database will only float around 1000 records max and with the current 250 records I'm only seeing a db size of 25mb.

  4. #4
    simonwait is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    3
    Quote Originally Posted by June7 View Post
    Advise not to embed files within db - this uses up Access 2GB size limit.

    Review https://sourcedaddy.com/ms-access/wo...nt-fields.html

    Sorry - I was looking at this on my phone when i replied last time and didn't notice the link. Thats perfect thank you!

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

Similar Threads

  1. Replies: 7
    Last Post: 03-22-2020, 02:05 PM
  2. Replies: 4
    Last Post: 04-10-2019, 06:15 PM
  3. manipulating a queries
    By kfc in forum Access
    Replies: 1
    Last Post: 10-19-2012, 08:41 PM
  4. Need some help manipulating database columns
    By flightsimguy in forum Queries
    Replies: 7
    Last Post: 02-17-2012, 02:22 AM
  5. Replies: 17
    Last Post: 08-26-2009, 11:27 AM

Tags for this Thread

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