I'm putting together a db of photographs. The fields are pretty basic: date, description, orientation, and imagepath (text field with path & filename of photo (jpeg)).

I have an image box in the report detail which is linked to the imagepath field. I want to display the photos in the report with the dimensions 3" x 5".

The problem I'm having is getting the size of the box to change based on the photo orientation. If photo is portrait, then box needs to be 3" wide x 5" tall. Else if photo is landscape, then the box needs to be 5" wide x 3" tall. I've gotten coding help from the forum before, but as is, the box will change based on the first record's orientation but will not change based on the orientation of the subsequent records.

Here is what I have. Any suggestions?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Me.ImageFrame.Picture = Me.ImagePath

If Me.Orientation = P Then
Me.ImageFrame.Width = (3 * 1440)
Me.ImageFrame.Height = (5 * 1440)
Me.ImageFrame.Width = (5 * 1440)
Me.ImageFrame.Height = (3 * 1440)
End If

End Sub