Re: Need to use VBA to put image on a form



Stephen,

Thanks. I put the image in a separate form (so the buttons and text boxes on the first form
will be unaffected by the scrolling), and made it large as you suggested. That does give me
scroll bars, but only because I've made the image large, but still unzoomable. The user
needs a normal image sometimes and a zoomed image sometimes. I've looked briefly at your
A2KLoadJpegGifVer30D.mdb. Nice. I can probably integrate it into this attempt in Access
and get the zoom capability. But there's more needed.

Let me take a moment to describe the project. It is replacing a data entry form that's
currently implemented in Excel (which I can make dance and sing with VBA, though I can't yet
with Access). As the user goes through each record a document image is fetched and placed
onscreen. The user sometimes needs to visually extract information from the image, which is
then keyed in. Some images are difficult to read. The Excel program allows for zooming,
changing contrast and brightness, and rotating 90° left. These are the image capabilities
we need.

Is there functionality available for any of rotating and changing brightness and contrast?
--
Earl Kiosterud
www.smokeylake.com

-----------------------------------------------------------------------
"Stephen Lebans" <ForEmailGotoMy.WebSite.-WWWdotlebansdot...@xxxxxxxxxxxx> wrote in message
news:eV%23sKpjqHHA.4268@xxxxxxxxxxxxxxxxxxxxxxx
HI Rob,
the OP can place an Image control, sized to 22. in x 22 in. on a form sized the same. In
this way the form's native ScrollBars can be used to scroll the contents of the Image
control. For a sample MDB using this method see:
http://www.lebans.com/loadjpeggif.htm

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


"Rob Parker" <NOSPAMrobpparker@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23U9kBRjqHHA.1220@xxxxxxxxxxxxxxxxxxxxxxx
Hi Earl,

Glad it's working. As for your latest question: the standard image control (or the bound
or unbound OLE controls) does not let you resize, or provide scrollbars. You set it to
the size you want your image to display at on-screen, and that's it. As I said in my
earlier post, if you set the size mode to zoom, your image will always be displayed fully
(ie, not clipped, and possibly expanded to fit but still retaining its original aspect
ratio).

There may be a third-party control which will do what you want, but I'm not aware of any.

Rob


"Earl Kiosterud" <someone@xxxxxxxxxxx> wrote in message
news:eFzDO3dqHHA.4740@xxxxxxxxxxxxxxxxxxxxxxx
Rob,

Worked great. Thanks. I got questions -- you got answers! Only this ain't Radio
Shack.

I changed the Picture Type property to Linked (don't need to keep it in the data base).
I added code to check for the existence of the image file and reset the image
(Me.Image15.Picture = "") if it doesn't exist.

Is there a control that will let me increase the size of the image, then use scroll bars
to pan around? I've looked at all the properties of the Image control that I'm using
now, and I don't see anything.

--
Earl Kiosterud
www.smokeylake.com

Note: Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"Rob Parker" <NOSPAMrobpparker@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uNl9PbYqHHA.1172@xxxxxxxxxxxxxxxxxxxxxxx
Hi Earl,

Use an Image control to display the photo, and place code like the following in the
Current event of the form. This assumes that the path/filename of the image file
is in a textbox control named txtImageFile, bound to the table field where the
path/filename is stored. I use the same code in the AfterUpdate event of the textbox
to update the picture if the path/filename is changed.

If Not IsNull(Me.txtImageFile) Then
Me.imgImage.Picture = Me.txtImageFile
Else
Me.imgImage.Picture = ""
End If

If you don't want to have the image filename visible on your form, you can hide the
textbox control, or simply refer to the field in the code, rather than to the control
holding the field's content; in that case, the first line would be:
If Not IsNull(Me!ImageFieldName) Then

And another tip - if you set the Size Mode of the image control (it's on
the Format tab in the Properties dialog) to Zoom, your image will resize to
fit the control, and retain its aspect ratio.

Finally, to prevent possible crashes when scrolling through records, you should
incorporate the registry changes described here:
http://www.mvps.org/access/api/api0038.htm

HTH,

Rob

"Earl Kiosterud" <someone@xxxxxxxxxxx> wrote in message
news:e4S6h7XqHHA.5092@xxxxxxxxxxxxxxxxxxxxxxx
I think that was a bit too terse. The image I want to put on the form is a jpg image,
the file name of which I'll be able to get from a field in the record in the associated
table. There's an image for each record.

--
Earl Kiosterud
www.smokeylake.com

Note: Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"Earl Kiosterud" <someone@xxxxxxxxxxx> wrote in message
news:e1WbrvXqHHA.1288@xxxxxxxxxxxxxxxxxxxxxxx
Hello folks,

I need to have an event-fired sub put an image on a form. It needs to be fired when
the form is advanced to the next record. I don't know how to code it. Thanks

--
Earl Kiosterud
www.smokeylake.com















.



Relevant Pages

  • Re: Need to use VBA to put image on a form
    ... The embedded OLE object with Excel automation sounds workable. ... Earl Kiosterud ... Note: Some folks prefer bottom-posting. ... the OP can place an Image control, ...
    (microsoft.public.access.formscoding)
  • Re: Need to use VBA to put image on a form
    ... Image into the Excel sheet via Automation. ... That does give me scroll bars, ... the OP can place an Image control, ... Note: Some folks prefer bottom-posting. ...
    (microsoft.public.access.formscoding)
  • Re: How do you interactively write to a CEditView Window
    ... When you scroll the ... the window flashes a lot. ... and trying to control the flashing and deal with the user resetting ... note that sizeof() a string will include the NUL character, while what you really want is ...
    (microsoft.public.vc.mfc)
  • Re: Cannot enter edit boxes on CProperty pages
    ... Are you trying to make the propretysheet scroll, ... tab control to switch pages and on a PC an OK button. ... to an edit box with mouse and edit it, nor does it seem tab keyboard ... not on WinCE device ...
    (microsoft.public.vc.mfc)
  • Re: Image Display Problem !
    ... The table contains approx 500 records and the database size is 1gb. ... Now when I try to scroll the "bound control" even by holding the mouse ... The moment I enable my linked image control, ...
    (comp.databases.ms-access)