Images on Continuous SubForm (1 Viewer)

jharding08

Member
Local time
Today, 08:33
Joined
Feb 16, 2021
Messages
34
I have a subform that is linked to a continuous form that has an image box. The continuous form runs off a query with a field for photo path. I need to format the image box to show the picture in field (by path) if there is a path in the field, but if not, then default to a grey image (default stock image).

With a continuous form, when I check if the picture path is null in Form_Current() it will always default to the first record, how do I check each record? I know with a command button I can get it to focus on individual records, can I set the picture in a command button too?
 

jharding08

Member
Local time
Today, 08:33
Joined
Feb 16, 2021
Messages
34
It was easier than I thought. Just set the default picture image to the greyperson, then set the control source to the path from the query. Only problem is that the default picture path for the image box is hardcoded and I have a function that sets the default "greyperson" path. How would I set the default picture of the image box to a function?
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:33
Joined
May 21, 2018
Messages
5,505
If you are storing the path and this is an bound image control you can store the default path in a table. Untested but something like.

PicturePath: iif(isnull([picturefield]),dlookup("defaultPath',"tblApplicationSettings"),[pictureField])

in other words you store the default path in your application settings table. If the path is not null use the path else look up the default in the application settings.
 

jharding08

Member
Local time
Today, 08:33
Joined
Feb 16, 2021
Messages
34
So in this instance with a continuous for, it only works to set the picture path in the query vs. code? Makes sense, I'll try it
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:33
Joined
May 21, 2018
Messages
5,505
See demo. I did not make this a continuous form, but I can guarnatee it would work. You first must browse to the default folder. You will see the ones without an image name show the grey guy.
 

Attachments

  • DemoImage.zip
    1.3 MB · Views: 112

jharding08

Member
Local time
Today, 08:33
Joined
Feb 16, 2021
Messages
34
Adding the default image to the construction of the field in the query seemed to work, thank you.

One last question on the continuous form - it seems like there is a blank space, like another blank record at the end and I have allowadditions=No. Furthermore, in a datasheet view, there is not a empty last record

Continuous Form Design View (two subforms, bottom one continuous):
1614274102274.png

Properties for Bottom Subform (Continuous Form):
1614274333900.png


Top of Continuous form:
1614274084176.png


End of Continuous form(If you pull scroll bar down it goes to just below the last record, but if you click the down arrow in the scroll it goes one step further)
1614274301745.png
 

Attachments

  • 1614274200115.png
    1614274200115.png
    46.9 KB · Views: 158

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:33
Joined
May 21, 2018
Messages
5,505
I would add a different color footer for test purposes. This may help idenitfy what the 'dead space" is. It is hard to tell if that is the form, subform, new record, etc.
 

jharding08

Member
Local time
Today, 08:33
Joined
Feb 16, 2021
Messages
34
Set the continuous form backcolor to blue. There is no footers or headers
1614280812645.png


Whole subform shows blue so it has to be the child continuous form adding space.
1614280870614.png



Could it possibly be default behavior?

Also put a form header/footer in the child form to see and it shows the space in blue still with the footer a different color
 
Last edited:

jharding08

Member
Local time
Today, 08:33
Joined
Feb 16, 2021
Messages
34
Been researching this and cant find any rhyme or reason why the extra space shows for a continuous form and not on a datasheet (no new record). It has to be the detail section and it has to be the form, not the subform container on the main form.

I've messed with auto-resize, border style, fit to screen, can grow, can shrink, but nothing stops the scroll bar from showing a ton of blank space after the last record.
 

Users who are viewing this thread

Top Bottom