Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Imaging Seminar Lessons    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
L16 Code
Darren McMartin 
    
2 years ago
I had to add in an UpdatePicture before the Exit Sub if you choose not to Overwrite, otherwise the form wasn't updated. The code I have for it now is the following. I'm interested if anyone sees any issues with it or a way of improving it.

DetailsPrivate Sub EmployeePictureBtn_Click()
    
    Dim PathFilename As String
    Dim FilenameOnly As String
    Dim L As Integer
        
    L = Len(ImagesFolder)                   'C:\Users\djemc\OneDrive\... \Images\  129
    PathFilename = PickFile(ImagesFolder)   'C:\Users\djemc\... \Downloads\rick1.jpg
    FilenameOnly = GetFilenameOnly(PathFilename)    'rick1.jpg
    EmployeePicture = FilenameOnly
    
    ' Check and see if we're in the images folder already
    If Left(PathFilename, L) <> ImagesFolder Then
        ' I'm NOT in the images folder, copy the file
        FilenameOnly = EmployeeID & "-" & FilenameOnly  '1-rick1.jpg
        If Dir(ImagesFolder & FilenameOnly) <> "" Then
            ' The file already exists, ask to overwrite.
            If MsgBox("File already exists. Overwrite it?", vbYesNo) = vbNo Then
                UpdatePicture
                Exit Sub
            End If
        End If
        FileCopy PathFilename, ImagesFolder & FilenameOnly
    End If
        
    EmployeePicture = FilenameOnly
    UpdatePicture

End Sub
Darren McMartin OP  @Reply  
    
2 years ago
That was after Lesson 16, not Lesson 15.
Darren McMartin OP  @Reply  
    
2 years ago
Just one more thing, is there a way of adding the EmployeeID at the end of the name so you get rick-1.jpg?

Sorry for all the questions, but I had to mesh together the new PickFile with the old LaunchCD code.
Richard Rost  @Reply  
          
2 years ago
Thanks for sharing. :)

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Imaging Seminar Lessons.
 

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: 4/30/2026 9:43:49 AM. PLT: 0s