Hello all.
I'm having an issue trying to create a report using Access and VBA. The project is actually creating a product catalog ... and I have used a report to do so. I don't have a lot of knowledge of Access VBA (but do have experience with VB).
The problem that I am trying to tackle is of adding an image above each categories header that displays an advertising banner (from a different table that is linked to the product table) for that given category. The way I have it set up now is that I have a second group header that displays before the main (category) group header.
The tricky part is that not every category has an image that goes along with it ... and when there is not one, I need for that section to not show up. I've tried a few different things (mainly suggestions I've been given elsewhere), but have not gotten anything to work.
How can I test the "Image" field to see if it's null for each category that displays on the report?
Can I do something like:
If IsNull ([somehow access the 'Image' field here]) Then
GroupHeader1.Visible = False
Else
GroupHeader1.Visible = True
End IF
If I can ... how do I reference the field I need to reference in the IF?
Thanks in advance!
Name of report: "Grocery Section"
Section Name: GroupHeader1
Field needing to be tested: Image
Control holding the image: Image39
Table with the images: "Advertising Images"
I'm having an issue trying to create a report using Access and VBA. The project is actually creating a product catalog ... and I have used a report to do so. I don't have a lot of knowledge of Access VBA (but do have experience with VB).
The problem that I am trying to tackle is of adding an image above each categories header that displays an advertising banner (from a different table that is linked to the product table) for that given category. The way I have it set up now is that I have a second group header that displays before the main (category) group header.
The tricky part is that not every category has an image that goes along with it ... and when there is not one, I need for that section to not show up. I've tried a few different things (mainly suggestions I've been given elsewhere), but have not gotten anything to work.
How can I test the "Image" field to see if it's null for each category that displays on the report?
Can I do something like:
If IsNull ([somehow access the 'Image' field here]) Then
GroupHeader1.Visible = False
Else
GroupHeader1.Visible = True
End IF
If I can ... how do I reference the field I need to reference in the IF?
Thanks in advance!
Name of report: "Grocery Section"
Section Name: GroupHeader1
Field needing to be tested: Image
Control holding the image: Image39
Table with the images: "Advertising Images"
Last edited: