Hello.
Hope all are well.
I have odbc linked tables that prevent me from normalizing into master detail. Master=model_number. And Detail=multiple photos.
I need to create a report.
For each Detail Record (model number) I need to show a main photo and 3 details photos.
The name and path to the photos is contained in the model number table which has fields.
Model_num
image_main
image_detail_1
image_detail_2
image_detail_3
If a particular model number does not have all 3 details or has none, I am trying to make the control become invisible. I am using this code… but it is stalling and giving errors that it can not open the image file. In the case that it can not open the image file, the code should jump down to the where the on_error_goto tells it, but it does not. It returns an error.
The idea of this code is similar in logic to nested if then logic. It uses nested on_error_goto.. to cycle through each image control on the report.. If it gets an error it makes in invisible and moves on.
Any thought would be much appreciated. The code follows.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.imgVisual.Visible = True
Me.imgVisual1.Visible = True
Me.imgVisual2.Visible = True
Me.imgVisual3.Visible = True
On errror GoTo Err_DisplayImage
Me.imgVisual.Picture = Me.ImgTextPath
On Error GoTo Err_DisplayImage1
Me.imgVisual1.Picture = Me.ImgTextPath1
On Error GoTo Err_DisplayImage2
Me.imgVisual2.Picture = Me.ImgTextPath2
On Error GoTo Err_DisplayImage3
Me.imgVisual3.Picture = Me.ImgTextPath3
Err_DisplayImage:
Me.imgVisual.Visible = False
On Error GoTo Err_DisplayImage1
Me.imgVisual1.Picture = Me.ImgTextPath1
On Error GoTo Err_DisplayImage2
Me.imgVisual2.Picture = Me.ImgTextPath2
On Error GoTo Err_DisplayImage3
Me.imgVisual3.Picture = Me.ImgTextPath3
Err_DisplayImage1:
Me.imgVisual1.Visible = False
On Error GoTo Err_DisplayImage2
Me.imgVisual2.Picture = Me.ImgTextPath2
On Error GoTo Err_DisplayImage3
Me.imgVisual3.Picture = Me.ImgTextPath3
Err_DisplayImage2:
Me.imgVisual2.Visible = False
On Error GoTo Err_DisplayImage3
Me.imgVisual3.Picture = Me.ImgTextPath3
Err_DisplayImage3:
Me.imgVisual3.Visible = False
End Sub