Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

file presence yes or no

Posted on 2015-01-01
2
Medium Priority
?
137 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

660 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