1 Reply Latest reply on Jul 10, 2013 12:47 PM by philmodjunk

    Auto-Enter Pics in Containers



      Auto-Enter Pics in Containers


           I have created a database which I would like to have containers auto fill based on a dropdown in the database.  It is a pretty flat database but this is a description.

           I have approxmiately 1000 pictures total.  On each record I have 6 container fields, all with pictures in the first container in each record.  I have set up a tab that would allow me to associate other items and would like the first picture in each record to show in the container field in that tab.  This would show the association of the item with the current item being looked at.  Is there a way to make a selection from the dropdown and have the picture in the first container show in the current record.

           Thanks in advance.

        • 1. Re: Auto-Enter Pics in Containers

                    It is a pretty flat database... On each record I have 6 container fields,

               That's Problem #1. You should consider setting up a related table where each record has a single container field for a single image. That offers a great deal more flexibility.

               I don't know if this is truly the case, but it sounds like you want something fairly similar to an invoicing system where you can select multiple items to be sold on the invoice and you want to see a picture of each item selected for that invoice. You might be doing something much different than buying or selling here, but in terms of the interface--that's my best guess on what you are doing. It might be a purchase order, a Bill of Materials (BOM) or something else, but that select a list of items and see their picture part of the process is quite similar in each case.

               MainTable::__pkMainTableID = SelectedItems::_fkMainTableID
               Items::__pkItemID = SelectedITems::_fkItemID

               For an explanation of the notation that I am using, see the first post of: Common Forum Relationship and Field Notations Explained

               With such an approach, you'd define a container field in Items into which you would insert your pictures. Then you'd set up a portal to SelectedItems on your MainTable layout and include that container field from Items inside the portal row. When you select an item in the _fkITemID fieild, the image for that selected item will appear in the container field in the portal.

               Please note that in some situations, such as the BOM that I mentioned, MainTable and Items can be two Tutorial: What are Table Occurrences? of the same data source table.

               You can examine the invoices starter solution for a working example of this setup and how you might select items in the portal. (It won't show pictures though). And I'm not ignoring the fact that you've mentioned that you have approximately 1000 pictures here either. The drop down list method in the starter solution can be less than ideal for long lists of values from which to choose, but once you get those basics in place and working, you can explore various other options that work with the same basic design but make selecting an item much more user friendly.