Union Form Alternative Image Controls

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zachary94
    New Member
    • Mar 2016
    • 1

    Union Form Alternative Image Controls

    So here's the long version:
    I'm trying to get the image associated with each record to be displayed in the "picture" field of a form. I usually have much success doing this by using attachment and hyperlink fields. So far, displaying images in forms have not been a problem because I have never had to union the records from all my tables and display them in a "read and write" form, but now that I have to, it seems that the union query does not support multi-valued fields except OLE objects, but as it turns out, although the union query can run with an OLE field, the images attached to the field can not be displayed by conventional means (I watch youtube for this kind of thing), for now, the only that's that's worked is converting the hyperlink fields (which contains all the pictures) into a short text field (which is much easier than trying to figure out each individual file path name). I did some coding according to a video i watched and it worked. but the problem I'm having now is that although the image is displayed (based on the filepath) there seems to be no way of editing them (adding/removing/replacing) through the form. it's just there and I want my users to be able to add not only records of each student, but also attache their photos as well.

    Short version:
    So here's my real QUESTION:
    is there a way to create an "insert image" button/option that links to the picture (short text) field that would let me add/remove a hyperlink as I would for a normal attachment field. likewise, if there are any alternatives to the union query (because its been giving me a lot of problems anyway), suggestions would be great.
  • PhilOfWalton
    Recognized Expert Top Contributor
    • Mar 2016
    • 1430

    #2
    Bad news: The fields in UNION Queries are not editable. Assuming each half of the UNION Query is editable (and many queries are not) it sounds as if you will have to use 2 separate forms

    Phil

    Comment

    • jforbes
      Recognized Expert Top Contributor
      • Aug 2014
      • 1107

      #3
      It's quite possible that if you are using a union query, you may want to reexamine your table structures. In a well designed database, unions aren't used very often, and it's very rare that a Form's RecordSource is based on a union query.

      This a good resource that explains database normalization, which may be of benefit for you: Database Normalization and Table Structures

      I would also highly recommend not using multivalued fields. This also goes back to a well designed/Normalized database. Multivalue fields aren't exactly normalized, which also means that they do not query well, or at all. For any field that you would have a multivalued field, I would create a separate table and link it to the Primary Key of the base table. For editing and display purposes, you can use a Sub-form.

      Lastly, for your actual question, the ImageControl itself doesn't support any lookup functionality for the Image. Basicaly, the ImageControl is Read Only. You will have to write that yourself. Mostlikely by placing a button somewhere close to the Image to allow the user to select a file. This is a good place to start for a File Seleciton Dialog Box: Select a File or Folder using the FileDialog Object

      Comment

      Working...