+ Reply to Thread
Results 1 to 28 of 28

Print selected ID photo based on student ID entered

  1. #1
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Print selected ID photo based on student ID entered

    ******MILLIONS THANKS TO GENIUS BAKERMAN2 FOR YOUR SUPER QUICK HELP. YOUR CODE WORKS LIKE A MIRACLE. GOD BLESSS YOU FOR KEEPING YOUR PROMISE TO HELP WITH MY WORK. ******


    Hi Super coders

    Hope you are all well.
    I need your help please.
    Attached is the program that requires coding so that user can print the Student ID photo on the Photo ID printer.
    SEARCH - User will need to enter Student ID to display the record if existing.
    ADD - allows user to add new picture into the existing
    PRINT PREVIEW - 7 pictures ID size with the Student ID, Name, Date picture taken.

    Thank you so much for your help.
    Attached Files Attached Files
    Last edited by jojo4santa; 06-03-2025 at 01:41 PM. Reason: Thank you

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: ID photo

    I would strongly advice against putting pictures in an excel file. It will become massive.
    Put all pictures in 1 specific directory. Name them,starting with the student ID and maybe date taken.
    In your file create a userform with a TextBox, ListBox, CommandButton and an Image Control. Use the TextBox to search for an ID and the ListBox displays all results found.
    Click a filename to get a preview in the Image Control. When found click the CommandButton to transfer the selected image to the worksheet to be printed.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    codes needed

    thank you so much bakerman2 for your super quick help as always. I will create the userform as suggested. All the stars rep to you for your wise suggestion.

    I updated the workbook that I just completed all the buttons. Sleep well. Thanks a lot for your kind, quick help as always bakerman2.
    Attached Files Attached Files
    Last edited by jojo4santa; 06-02-2025 at 11:26 PM. Reason: userform data entry new attachment

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Print selected ID photo based on student ID entered

    I already created 1 for you to try.
    In the Userform chage path to photos. Change Id in B1 to start everything.
    Make sure photos are saved as IDnumber and date like 100A_10052024 or 431B_0316/2024.
    Select 1 of the photos in Listbox to get a preview, pressing Confirm puts them on the worksheet.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    I was about to create one as you directed luckily I read your message and saw your very beautiful design. Thank you so much bakerman2 for your super quick help.
    I am trying to do the other part. thanks millions bakerman2

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Print selected ID photo based on student ID entered

    Nice to hear.
    Also put next code in ThisWorkbook module. It will clear Image controls before closing the file to keep filesize to normal.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    Hi bakerman2, I need your help please. How can i send you the workbook userform? thanks a lot

  8. #8
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Print selected ID photo based on student ID entered

    Can't you just post the workbook containing Userform here ?

  9. #9
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    there is no attachment option. How could you send the workbook to me but I can't to you?. I can't see the attach option bakerman2

  10. #10
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    should I edit post with new attachment? thanks a lot

  11. #11
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Print selected ID photo based on student ID entered

    Follow the link in the yellow banner at the top of this thread for instructions on how to attach a sample workbook.
    PS: You already posted 2 example files in this thread so what seems to be the trouble ?
    Last edited by bakerman2; 06-02-2025 at 06:16 PM.

  12. #12
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    Thanks bakerman2 for your quick help. I need the vba code for the program (2nd workbook) to work

  13. #13
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Print selected ID photo based on student ID entered

    It's almost 3 AM over here so of to bed. I'll have a look tomorrow if that's ok for you.
    Last edited by bakerman2; 06-02-2025 at 08:53 PM.

  14. #14
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    thank you so much bakerman2. I just finished the program with all the buttons. The only thing left that I need is the PRINT BUTTON for 7 photos ID (as the 1st Excel attach) with the student ID, name on the photo. Let me send you the program now. thanks millions

  15. #15
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Print selected ID photo based on student ID entered

    Yellow button opens DataEntry form.
    Check 1st row of database. I,ve entered a student ID and path to photo. Adjust for testing purposes.
    You can either use Upload Image button to select random photo and PrintPreview button to view PrintPreview or enter Student ID and press Search button (photo gets autoloaded).
    Press PrintPreview button to view PrintPreview.
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    Billions of stars to Genius bakerman2. thank you so much for your talent & super quick help. I only have one more thing that the drop down Country of Birth should be linked to the tab of all the country. Could you please help me? thanks genius. i wish i could add millions of stars to your rep

  17. #17
    Valued Forum Contributor
    Join Date
    03-05-2025
    Location
    Deutschland
    MS-Off Ver
    MS Office Home & Business 2024
    Posts
    487

    Re: Print selected ID photo based on student ID entered

    Hi Jojo,

    the code of bakerman2, but like this:

    Please Login or Register  to view this content.
    BR, Alexandra
    Best regards, Alexandra

    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved"

  18. #18
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Print selected ID photo based on student ID entered

    Or this one.
    Please Login or Register  to view this content.

  19. #19
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    Thank you so much Alexandra for your code. stars added to your hard work. Genius bakerman2's code works like miracle saving my life. I did change the word to the sheetname after running the code. I'd appreciate your help.
    Last edited by jojo4santa; 06-03-2025 at 10:35 PM.

  20. #20
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    that's super quick. again genius bakerman2's code always work like a miracle. I can never thank you enough for your super quick help. I wish i could add another billions stars to your rep. I did try again and again but the system does not allow me to. Attachment 894308

  21. #21
    Valued Forum Contributor
    Join Date
    03-05-2025
    Location
    Deutschland
    MS-Off Ver
    MS Office Home & Business 2024
    Posts
    487

    Re: Print selected ID photo based on student ID entered

    You´re welcome!

  22. #22
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    bakerman2 when I click on Preview Picture, an error says "subscript out of range" and hilited at the sID, wDate. Also, the photo displays but the studentID, name, date photo taken does not show. Could you please kindly help me? thanks millions

  23. #23
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Print selected ID photo based on student ID entered

    Make sure photos are stored in the format StudentID_Date taken without backslashes e.g. 100A_10052024.jpg

  24. #24
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    I did try everything but it comes up with error message. Is that possible to just show the student ID, name and the date that the photo is printed (=today's date)? thanks millions again for your quick help

  25. #25
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Print selected ID photo based on student ID entered

    I've taken a closer look at your code and I think I figured out your MO.
    In the attachment fill out all student details and then click Upload Image. After that click Save.
    After that you can enter that Student ID in the search textbox and click Search. All should appear just fine. Now click Print Preview.
    Use only numeric student ID.
    Attached Files Attached Files

  26. #26
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    your code works like a magic. Thanks billions bakerman2 for your super miraculous, quick code and for fixing the design which looks so excellent. I love it every bit. Your code is always perfect. Thanks billions for your Attachment 894356hard work and help my work life much easier now. I am overjoyed. Words can't express enough. You save my life. May God bless you!

  27. #27
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,569

    Re: Print selected ID photo based on student ID entered

    Thanks for your kind words.
    You may also have noticed I've fixed the Listbox and 2 Buttons below.
    First select a row in the ListBox , the Edit button then transfers all data to the Textboxes above.
    Selecting a row and clicking the Delete button removes the selected row from the database.
    The Textbox can be used to Filter the ListBox by LastName. Start typing the LastName, the more you type the finer the ListBox gets filtered.

  28. #28
    Forum Contributor
    Join Date
    12-11-2023
    Location
    los altos, ca
    MS-Off Ver
    2016
    Posts
    156

    Re: Print selected ID photo based on student ID entered

    wow....the additional code for the listbox filtered by StudentID works like magic. another billions stars & thanks to Genius bakerman2. I tried to add more rep but the system is unfair does not allow me to do so. You're the greatest, amazing super coder. So quick, so awesome. God bless you for always helping out so quickly. It might take me couple years to figure out how to do it. You again save my work life much easier.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Centering photo macro not placing photo correctly
    By MattHamby in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-25-2019, 06:36 PM
  2. [SOLVED] I want the photo to be empty when there is no photo for the employee(Userform)
    By leprince2007 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-22-2016, 12:19 PM
  3. Replies: 0
    Last Post: 10-16-2016, 10:48 PM
  4. Need help with VBA (calling photo)
    By Akbaruu in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-05-2015, 01:09 PM
  5. add photo
    By MetteGaga in forum Suggestions for Improvement
    Replies: 3
    Last Post: 07-23-2015, 05:40 AM
  6. Add Photo
    By rithamworld in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2014, 01:10 PM
  7. [SOLVED] Photo's in Excel
    By Avalonexile in forum Excel General
    Replies: 0
    Last Post: 06-25-2012, 11:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1