Solved

file presence yes or no

Posted on 2015-01-01
2
131 Views
Last Modified: 2015-01-01
in my inventory form, i have a field that has the product code, ex. 10-1234. there is a corresponding jpg file that has the same product code ex. 10-1234.jpg.  on the form is a picture frame that should load the corresponding picture. the first question is how to update the frame to match the product code and if the corresponding jpg file is not there how can i test for this in vba code.
0
Comment
Question by:cazink
2 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 40527225
assuming you know the folder path where the jpg file is

dim strPath as string, strFile as string
strPath="c:\folderName\"

if dir(strPath & me.ProductCode & ".jpg") <> "" then
   ' your code to attach the image here
   else  
   msgbox "image not found"
end if
0
 

Author Comment

by:cazink
ID: 40527267
Thank you perfect, short and sweet.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now