Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Signatures    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Signature Not Saving Form ID
Kevin Swift 
     
4 days ago
I have all working for saving the signature except it will not put the id # in front of the   .gif  it is saving it as an un-named  .gif  if i go to the file and put the id # in manually it puts it in the pix box correctly on the right form.  My ID on the Table was just ID. any thoughts why it does not put the number in?

Private Sub SaveSignatureBtn_Click()

    Dim BA() As Byte, Filename As String, FF As Long
  
    On Error Resume Next
    MkDir CurrentProject.Path & "\Signatures"
    On Error GoTo 0
  
    Filename = CurrentProject.Path & "\Signatures\" & ID & " .gif"
      
    On Error GoTo NoSignature
    BA = Signature.Object.Ink.Save(2) 'GIF
    On Error GoTo 0
  
    FF = FreeFile
    Open Filename For Binary As #FF
    Put #FF, , BA
    Close #FF
  
NoSignature:
    Forms!AdoptionApplicantForm.Refresh
    DoCmd.Close , , acSaveYes
Kevin Robertson  @Reply  
          
4 days ago
Sounds like you have a Variable Not Defined.
Make sure you have Option Explicit turned on.

Do you have the hidden field on the signature form that gets the current ID from your open form?
If so, temporarily make it visible so you can see the value.
Richard Rost  @Reply  
          
3 days ago
Kevin is on the right track. If the file is being created as just ".gif" (or " .gif" in this case), then the value of ID is blank or Null when that line runs.

Also, remove the extra space before the extension:

Filename = CurrentProject.Path & "\Signatures\" & ID & ".gif"

However, I would avoid using a control/field named just ID. Make sure the signature form has a textbox (hide it if you want) containing the actual AdoptionApplicantID from the open applicant form. Then use that textbox explicitly in the filename, for example:

Filename = CurrentProject.Path & "\Signatures\" & AdoptionApplicantID & ".gif"

Make the hidden textbox temporarily visible and confirm that it contains the expected number before clicking Save Signature. If it is blank, the problem is in how the signature form is being opened or how that ID value is being passed into the form.

Also, your On Error GoTo NoSignature currently catches any error after that point, including file-writing errors, and then silently continues. That can make troubleshooting tricky. Kevin's suggestion to turn on Option Explicit is a good one too - it will catch a misspelled or undeclared variable/control name.
Kevin Swift OP  @Reply  
     
2 days ago
Yes setting the id to the signature text box works. Thanks
Add a Reply Upload an Image
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: 8/18/2026 12:26:08 AM. PLT: 1s