Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Image Control Source Can I Test the File Type
Stephen Reynolds 
     
14 months ago
I have an image control source that usually points to an image file, it works fine.  I would like to point also to video, which the image control  won't handle because of size.   If the control points to MP4 file, I want to display a specific message instead of failing.   something like :
      IF SOURCE IS MP4 THEN
         SOURCE = ERROR
      ENDIF
Can this be done with the expression builder for the control source?  Thanks.
Stephen Reynolds OP  @Reply  
     
14 months ago

Stephen Reynolds OP  @Reply  
     
14 months ago
This is the code I've tried - I've got the file extension stored in Obs_Image_Type and I'm trying to test its value for MOV or MP4 - if true, I want to set the image control source to display an error jpg, otherwise display the actual image.  It does not display the error jpg.
Stephen Reynolds OP  @Reply  
     
14 months ago
Hold on, still working on it.   the above comment was wrong - I think I can figure this out. Expression seems to be working, something else is not.
Alex Hedley  @Reply  
           
14 months ago
You could do the opposite:
Legacy Tip: Remove file extension
Stephen Reynolds OP  @Reply  
     
14 months ago
Alex - Thanks for the reply, but what I needed to do was determine if the control source was a file sufficiently small for the image control to display - video files are too big and cause error.   My problem was that I had added a field Obs_Image_Type to the source table and saved that, I had added the code to save the file extension in the VBA in my form which let me browse and select a file, but the extension was not actually being saved.   I've seen this before - if I add a field to a table, in order to use it on a form I have to add the field to the form, even if it is not to be displayed; then, I can delete the field from the form, but Access now 'knows' about it, and I can use it in VBA etc.   I've got it working as I want, with the expression shown above, plus the VBA to estract and save the file extension.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/7/2026 7:31:29 AM. PLT: 0s