Solved

file presence yes or no

Posted on 2015-01-01
2
126 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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

744 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

10 Experts available now in Live!

Get 1:1 Help Now