opening a JPG with VB through MSAccess
-
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.
-
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.
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
-
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
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.
-
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.
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.
-
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.