Open form with image

  • Thread starter Thread starter maxbrit
  • Start date Start date
M

maxbrit

Hello

Have a form GoodsIn with a control StockImage that has the path to a jpg
image of the stock item.

The form GoodsIn has a button to open a form DisplayImage intended to show
this image within control Image0

How do I set the source for Image0 = StockImage?

Thanks for any help

Maxwell
 
Hello

Have a form GoodsIn with a control StockImage that has the path to a jpg
image of the stock item.

The form GoodsIn has a button to open a form DisplayImage intended to show
this image within control Image0

How do I set the source for Image0 = StockImage?

Thanks for any help

Maxwell

Let's see if I have this right.
Form1 has a control that displays the path (and the picture name, i.e.
"c:\FolderName\PeachCobbler.jpg") to an Image.
The user will click a command button to open a second form and you
wish to display the image shown in the first form control.

A couple of different ways.
1) Use the OpenForm OpenArgs property to pass the Path to the second
form.
DoCmd.OpenForm "DisplayImage", , , , , acDialog, Me!StockImage

Note: the acDialog is optional, but you must retain the comma place
holder if you don't want to stop processing until you close this form.

Code the Load event of the second form:
If Not IsNull(Me.OpenArgs) then
Image0.Picture = Me.OpenArgs
End If

or ....

2) Code the Load event of the second form:
[Image0].Picture = forms!GoodsIn!StockImage

In this case, the form "GoodsIn" must remain open.
 
Many thanks Fred.



fredg said:
Hello

Have a form GoodsIn with a control StockImage that has the path to a jpg
image of the stock item.

The form GoodsIn has a button to open a form DisplayImage intended to show
this image within control Image0

How do I set the source for Image0 = StockImage?

Thanks for any help

Maxwell

Let's see if I have this right.
Form1 has a control that displays the path (and the picture name, i.e.
"c:\FolderName\PeachCobbler.jpg") to an Image.
The user will click a command button to open a second form and you
wish to display the image shown in the first form control.

A couple of different ways.
1) Use the OpenForm OpenArgs property to pass the Path to the second
form.
DoCmd.OpenForm "DisplayImage", , , , , acDialog, Me!StockImage

Note: the acDialog is optional, but you must retain the comma place
holder if you don't want to stop processing until you close this form.

Code the Load event of the second form:
If Not IsNull(Me.OpenArgs) then
Image0.Picture = Me.OpenArgs
End If

or ....

2) Code the Load event of the second form:
[Image0].Picture = forms!GoodsIn!StockImage

In this case, the form "GoodsIn" must remain open.
 
Back
Top