Display multiple attachments in Microsoft Access 2010 formats and reports

I was very pleased to open the application field in Access 2010. This is a feature that aesthetically annoys my inner database purist, but my inner lazy turf is here and it looks at first glance as if it could make one of my current projects a lot easier / easier. Fortunately, it displays images / icons automatically in forms and reports, but (why is there always, but eh!) It only displays the first one, and I need to display them all.

You can, of course, scroll through the attachments one at a time, but Iโ€™m sure my client will not wear it, despite his request that I complete the project in MS-Access, which, apparently, only has a very rudimentary construction in display options: / BUT ...

Maybe I'm wrong, I have almost no experience with MS-Access. My coding background is a reliable LAMP stack and network, so I am deeply unaware of what is offered in the Windows / Access ecosystem. I suspect there are great third-party reporting tools that give a very flexible layout, but I need to see all the attachments in the form, not just the reports.

So, skipping blindly into the void, my initial strategy is ...

Create a separate attachment table where each field is an โ€œattachmentโ€ containing only one element. Then use scripts in forms and reports to ...

  • Request this table for all attachments related to the corresponding record.
  • Display / format these fields as some kind of list
  • Dynamically add a new field at the end of this list so that the user can download the next attachment somewhere
  • Refresh the form page every time an attachment is added, so there is a free one.

So my questions are ...

  • What am I describing in Access accessible?
  • Am I missing a much simpler / better / canonical solution?
  • How powerful is an access scripting language with a link to a display? inconvenient or pixel?
  • Isn't that Visual Basic yet? (noooooo !;)
  • If there are any other scripting languages โ€‹โ€‹that I can use in forms / reports?

Sorry, I know this is a little long wool issue, but here I am a fish from the water!

Thanks,

Roger

+4
source share
2 answers

Let's say I have a table with an attachment:

attachment table

Let's say I have three images in one of the attachment fields that I want to display. I can create a request:

attachment query

Then I can create a continuous form:

attachment form

+7
source

I was looking for this for a similar problem. I have several attachments in the box. I intend to use the .jpg and .pdf storage field for the two image controls that I created by dragging the field from the properties onto the form. I called them ctlImage and ctlFeatures. I use this form as a non-modal pop-up with additional information in the form of a product catalog. So far I can search for entries in the product catalog and use the search result of the selected list to open the form with the where clause to set the data form to the current record. When I try to manipulate ctlImage looking for an image type, the only property that appears in intellisense is ctlImage.value. I was hoping to assign ctlImage jpg and ctlFeatures to pdf. Here is the frmProducts btnMoreInfo_Click code and the frmCatalogDetails code if one of them messed up the other.

Private Sub btnMoreInfo_Click() Dim db As DAO.Database Dim rs As DAO.Recordset Dim str As String Dim row As Long Set db = CurrentDb Set rs = db.OpenRecordset("tblProducts", dbOpenSnapshot) If Me.lstSearchResults.ItemsSelected.Count > 0 Then ' Debug.Print Me.lstSearchResults.Column(0) row = Me.lstSearchResults.Column(0) rs.MoveFirst rs.FindFirst "ProductID=" & row Debug.Print rs("Description") DoCmd.OpenForm "frmCatalogDetails", acNormal, , "ProductID=" & Me.lstSearchResults.Column(0, Me.lstSearchResults.ItemsSelected), acFormReadOnly, acWindowNormal Else MsgBox "You must select a product" Exit Sub End If End Sub 

and directory information

 Option Compare Database Dim db As DAO.Database Dim rs As DAO.Recordset Dim fld As DAO.Field Private Sub Form_Load() Set db = CurrentDb 'Set rs = db.OpenRecordset("tblProducts", dbOpenSnapshot) 'Set fld = rs("image") Debug.Print rs("ProductID") Debug.Print rs("Description") 'me.ctlImage.ControlSource = 'Me.ctlImage.CurrentAttachment = fld.Value End Sub 

Rs statements are commented out because I am having problems with this form recognizing rs from the parent form. I get with a block variable not set, but if I do rs.openRecordSet, the recordset goes back to the first line. Besides your answer above, I saw very little about how to manipulate the binding object, and the help was difficult because it does not even cover access to the attachment field. I am at a point where I will ask more than answer this topic, and I really appreciate the time that many of you take to give an answer. Rollin Motto: ask for help when necessary, ask for help when you ask, and remember where you came from.

0
source

All Articles