Importing database tables from Access

Hi all,
I have a database with several tables, each comprising several hundred records. Each record includes the filename of up to six images associated with the record (the images are in the same directory as the database file).
For each table, I need to construct a form that displays the filename, and alongside contains a button to display the image in real size or full-screen if the real size exceeds the screen size. But I’m not sure whether I need to use an Image button, Image control, or whether a macro is required. Can someone offer some guidance as to how to do this?
I’m not exactly a newbie, but I’m coming back to LO Base after a long absence, and it seems much has changed.
I’m running LO 7.6.4.4 on Win 11.

Images couldn’t be shown in real-size in Base directly. But you could start your image viewer by macro:
Base Guide 7.3 - Displaying linked Images and Documents

Hi RobertG. Thanks for that, but unfortunately it didn’t get me much further.
I know that real-size images would need to be shown in the OS image viewer; I’m looking for a way of opening that from the form.
I can’t decipher where the macro listed in that document gets the image filename - surely the name of the field in which that’s stored should be somewhere in the macro? I’m not much of a macro user: I’m only doing this job because I’m familiar with botany and IT, but not a database expert.
Also, I assume the “graphical_control” referred to in the text and macro are a graphical control in the form, but again, I can’t see how to set that up.
Sorry for my ignorance.

That would be one way to set this up, and you are free to follow this approach.
.
This macro assumes you put a graphical control on your form (same method as any other field for text or numbers) and name it (check the properties of the field/item/control). This control is “bound” to a column of the table/query on the second tab of the properties to show a smaller version of the picture fitted to te control.
.
So the macro does not ask the database, but gets information from the control on the form. So you don’t find the field in the database in the macro, but the name of the control.
.
Realize you are free to name controls as you like. You may use Peter, Paul and Mary or whatever you like. And you have to put this name in the macro."graphical_control" is only the placeholder here.

Hi Wanderer

Thanks for that, I got the graphical control working - simple, once you know how.

I have an issue with the macro, however. I have up to 6 images associated with each record. That means I will have 6 graphical controls, each with separate names. Will I need to have six instances of the macro loaded, each referring to a different graphical control?

That would be one simple approach, but only one will be active at any given time.
.
Another possibility would be to use the event wich caused the macro to run. It is given as parameter to to the macro and can be inspected. So one macro could find out, wich control caused the macro to run and get the bound field from this control.

OK, I’m totally out of my depth.

  • I have absolutely no idea of how to modify the macro in Base Guide 7.3 - Displaying linked Images and Documents to do what you are suggesting. Is it a separate macro?
  • Also, when I try to set up one macro, a) it doesn’t work, and b) it winds up in “My Macros and Dialogs”, not in the database. As this file, once complete, will need to be ported to another system altogether, I doubt My Macros will copy with it.
  • Finally, if I put several versions of the macro into the file, each associated with a different image control, do I change the “View” in the first line (SUB View(oEvent AS OBJECT)) to, let’s say, View_Flower, or View_Fruit, as appropriate?