Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. opening a JPG with VB through MSAccess

opening a JPG with VB through MSAccess

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    reegan41
    wrote on last edited by
    #1

    Is there code to open a jpg if I were using the vb editor in MS access? I need to click a button, then open the JPG. I have tried looking for controls but all are shareware which unfortunately is out of the question for my project. Does anyone know how to do this? I just need the picture to display (even if it is in the 'crappy' Windows Picture and Fax Viewer or whatever its called) Thanks a bunch.

    P 1 Reply Last reply
    0
    • R reegan41

      Is there code to open a jpg if I were using the vb editor in MS access? I need to click a button, then open the JPG. I have tried looking for controls but all are shareware which unfortunately is out of the question for my project. Does anyone know how to do this? I just need the picture to display (even if it is in the 'crappy' Windows Picture and Fax Viewer or whatever its called) Thanks a bunch.

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      Just pull the picture from the database and dump it into a picture box control...

      "The clue train passed his station without stopping." - John Simmons / outlaw programmer

      R 1 Reply Last reply
      0
      • P Paul Conrad

        Just pull the picture from the database and dump it into a picture box control...

        "The clue train passed his station without stopping." - John Simmons / outlaw programmer

        R Offline
        R Offline
        reegan41
        wrote on last edited by
        #3

        Sorry, I wasn't clear enough...the picture is just saved on the local machine, not in my database...I just need to open it using the filepath as a parameter. I'm going to use a button and its Click() event to automatically browse to this path and open it.

        J 1 Reply Last reply
        0
        • R reegan41

          Sorry, I wasn't clear enough...the picture is just saved on the local machine, not in my database...I just need to open it using the filepath as a parameter. I'm going to use a button and its Click() event to automatically browse to this path and open it.

          J Offline
          J Offline
          jerryj
          wrote on last edited by
          #4

          A simple example: Private Sub Command1_Click() Me.CommonDialog1.ShowOpen If Me.CommonDialog1.FileName <> "" Then Me.Picture1.Picture = LoadPicture(CommonDialog1.FileName) End If End Sub However you get the path\filename of the jpg (or bitmap or GIF), just load it into a picture box with the LoadPicture function.

          R 1 Reply Last reply
          0
          • J jerryj

            A simple example: Private Sub Command1_Click() Me.CommonDialog1.ShowOpen If Me.CommonDialog1.FileName <> "" Then Me.Picture1.Picture = LoadPicture(CommonDialog1.FileName) End If End Sub However you get the path\filename of the jpg (or bitmap or GIF), just load it into a picture box with the LoadPicture function.

            R Offline
            R Offline
            reegan41
            wrote on last edited by
            #5

            How do I use a PictureBox? Right now I have Dim picbox As PictureBox 'tried this and didn't work' picbox = LoadPicture("C:\file.jpg") 'tried this and got "type mismatch"' Set picbox = LoadPicture("C:\file.jpg")

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups