vba - Restrict Attachment File Size Access 2007 -
currently have database system has been designed log calls coming department. other agents on phone system information allowed attachments photographs, letters etc. allow attachments added there attachments control on form allow additional documentation added mentioned above.
the problem is, have found lot of people using system store large copies of manuals. causing file size of database shoot exponentially.
what know is, possible restrict file size of attachment through vba? example restrict 6mb.
to answer question following code return file size others mentioned above don't think want store attachments in access database database grow , may become unstable.
private sub checkfilesize(strmyfile) dim objfilesys scripting.filesystemobject dim objmyfile file set objfilesys = createobject("scripting.filesystemobject") set objmyfile = objfilesys.getfile(strmyfile) if objmyfile.size > 6000000 msgbox "file big.", vbokonly else msgbox "file ok.", vbokonly end if set objfilesys = nothing set objmyfile = nothing end sub
Comments
Post a Comment