Rang
Rang

Reputation: 55

How to remove images stored in access (.accdb)?

I'm trying to keep access database size to a minimum and need to remove several large images that previously were used but now aren't needed. My understanding is access files (.accdb) store images inside the database. Do you know if it's possible to remove it and how? TIA

clarification & solution: I had several different forms with different background images, however at this point I have figured it out (for Access 2013) -> under Form Design Tools -> Design -> Insert Image, then right click on the image you need to remove and then click on Delete. Done.

Upvotes: 4

Views: 3116

Answers (2)

Mike Lyons
Mike Lyons

Reputation: 31

If you want to completely remove all shared pictures in the database, or ones whose name matches a certain pattern you can do something like this:

Sub PurgeSharedImages(Optional strPattern As String = "*")
  Dim i As Integer

  For i = CurrentProject.Resources.Count - 1 To 0 Step -1
    If CurrentProject.Resources(i).Type = 1 And CurrentProject.Resources(i).Name Like strPattern Then 
      CurrentProject.Resources(i).Delete
    End If
  Next i
End Sub

Upvotes: 3

AdamsTips
AdamsTips

Reputation: 1776

Just to make it easier for anyone else looking for this answer, here is a screen shot of what this looks like in Microsoft Access 2010:

enter image description here

Upvotes: 5

Related Questions