Results 1 to 6 of 6
  1. #1
    sconard is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2009
    Posts
    10

    resize linked image onload


    Since there is no can shrink property to an image control, I am trying to code onLoad of form to check if the linked image has a path. There is no path property when referencing image control in vba. My expectation is that I need to set the height to 0 and then detect if it has a path and resize to default height with control set to zoom.

    Any ideas on how to check for existance of image control path in vba?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Images are external and a text field has path string?

    You want to check if the field has a value?

    If Not IsNull(Me!fieldname) Then
    'do something
    End

    Why bother with resizing image? What's wrong with blank box? Or have a generic image as substitute.

    Is this a single view form?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    sconard is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2009
    Posts
    10
    It is linked image control with path assigned from field value that is result of query.

    The control source for the image is the field [wood image] which is actually a path.
    In the following, Me![WOOD IMAGE] is always null as is Me![WOOD IMAGE].value even though there are images of wood generated by the report
    If Not IsNull(Me![WOOD IMAGE]) Then
    Image76.Height = 200
    End If

    Aesthetically the large blank space in the middle of the page that does not have a wood image associated is not desired.




    Quote Originally Posted by June7 View Post
    Images are external and a text field has path string?

    You want to check if the field has a value?

    If Not IsNull(Me!fieldname) Then
    'do something
    End

    Why bother with resizing image? What's wrong with blank box? Or have a generic image as substitute.

    Is this a single view form?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    If it's just a text field with a path string, should be able to reference it like any text field.

    Again, is this a Single view form or Continuous view? The property setting will affect all instances of the control. So if form is Continuous view and multiple records are viewable, they will all reflect the property setting.

    Don't allow a large blank space, use an alternate generic image if the text field is blank. Image control ControlSource can be an expression. Try:

    =Nz([fieldname], "alternate image path")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    sconard is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2009
    Posts
    10
    This is a continuous view report.

    It is a image control. If it were a text field, the "can shrink" property would handle the issue.

    The attempt is not to have a blank space or a space with an image that says "no image". The attempt is to resize the image control to allow for other image controls that are lower on the page to show in the same spot.

    Quote Originally Posted by June7 View Post
    If it's just a text field with a path string, should be able to reference it like any text field.

    Again, is this a Single view form or Continuous view? The property setting will affect all instances of the control. So if form is Continuous view and multiple records are viewable, they will all reflect the property setting.

    Don't allow a large blank space, use an alternate generic image if the text field is blank. Image control ControlSource can be an expression. Try:

    =Nz([fieldname], "alternate image path")

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I know what you are attempting and my info still applies. Setting property of control programmatically or statically will affect ALL instances of the control on form. If set for 0 height, ALL will be 0 height. This is because there really is only one control.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Wild Cards in Linked Image Names
    By Siiig in forum Forms
    Replies: 2
    Last Post: 01-11-2013, 01:01 PM
  2. Record Check on Form OnLoad
    By tramp82 in forum Forms
    Replies: 10
    Last Post: 10-19-2011, 07:19 PM
  3. Replies: 36
    Last Post: 10-04-2011, 11:19 PM
  4. Replies: 1
    Last Post: 12-05-2010, 02:34 AM
  5. Linked Image on Form
    By jheintz57 in forum Forms
    Replies: 0
    Last Post: 03-31-2010, 12:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums