Validation/Error Handling for Attachment Field?

unluckytoe

Registered User.
Local time
Today, 00:50
Joined
Oct 14, 2009
Messages
43
Hello:

I have a DB that has an attachment field used to storge EU agreements. Each record needs to have 1 signed EU agreement attached in order to save the record. Is there a way to have a validation/error handling rule that knows when 1 attachment is made, the save button goes from disabled to enabled?

Thank you:

Brian
 
You can use the On Current Event behind the form and add an if statement like this:

Replace the EUDoc with your field name, and the cmdSave with you save command button

Private Sub Form_Current()
If Me.EUDoc.AttachmentCount = 0 Then
Me.cmdSave.Enabled = False
Else
Me.cmdSave.Enabled = True
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom