I'm trying to create a report for a picture database that will print out each picture (jpeg) with its description. The report has an Image Frame that is linked to a text field with the path of the picture using the following code I got from a previous post on the forum:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me![ImageFrame].Picture = Me![ImagePath]
End Sub

The problem I'm having is that the orientation of some pictures are landscape and others are portrait.

My question is this: How can I get the Image Frame in the report to automatically change size (from 5"x3" to 3"x5") depending on which way the photo is oriented?

I'm assuming that I'd have to have a field which denotes the orientation. But I have no idea what the coding would be. Note - I have no VB programming experience.

Any help would be greatly appreciated!