Solved Picture Size Limit (1 Viewer)

TajikBoy

Member
Local time
Today, 11:52
Joined
Mar 4, 2011
Messages
82
Good morning site gurus !

Quick questions, working on a contact database and would like to include a pic of the business card in the contact form.

1. How would I display the picture in the field when form loads?
2. How can I limit the size of the file loaded so no pics about 100mb are loaded ! I was thinking more 100-150kb

Thanks in advance

Erol
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:52
Joined
May 7, 2009
Messages
19,230
you don't load it to the db.
you create a "sub-folder" and put all the imges there.

add a textbox to your table that will save the "path+ picture" to
this field.

add image control to your form and on the Load
event of your form set the image control's picture
property to the "path" field.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 13:52
Joined
Feb 28, 2001
Messages
27,163
Just a couple of comments to supplement what arnelgp said...

In answer to your question 1 - if the picture to be loaded is always the same, load it (as arnelgp suggested) in the form's OnLoad event. If the picture can vary for any reason, it might be better in the form's OnCurrent event.

In answer to your question 2 - again arnelgp is correct. You never load an image to the DB. You track the fully qualified file path OR you make it relative to the location of the database file - like a sub-folder, where you can use the file spec ./subfolder/picturefilename.JPG or whatever other file type is to be displayed. However, if for some reason you REALLY ABSOLUTELY had to know the file size, look up the FileSystemObject, which would allow you to look up the file's information if you had its specification. But using the method arnelgp showed you, there is no reason for you to worry about the file size.
 

Users who are viewing this thread

Top Bottom