Consulting

Results 1 to 2 of 2

Thread: Picture Box issue

  1. #1

    Picture Box issue

    Hello,

    I currently have a black image box in my form on access and i'm trying to code it so that it will find an image based on a variable. The code below comes up with an error run time 2220 -1509615163 can anyone see what i'm doing wrong?

    Dim strPic As String
    Dim strDatabasePath As String
    strDatabasePath = CurrentProject.Path
    Pic = strDatabasePath & "\images\" & Text2 & ".bmp"
    Me.Image26.Picture = LoadPicture(Pic)

  2. #2
    VBAX Regular
    Joined
    Jun 2009
    Location
    Dorset
    Posts
    60
    Location
    What is LoadPicture?

    Try this:

    Dim strPic As String
    Dim strDatabasePath As String
    strDatabasePath = CurrentProject.Path
    strPic = strDatabasePath & "\images\" & Text2 & ".bmp"
    Me.Image26.PictureType = 1
    Me.Image26.Picture = strPic

    NB: When are you running the code - I normally do it on the OnOpen of the form or OnCurrent.
    Regards
    JD
    ------------------------------------
    Software-Matters
    Dorset

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •