Solved Attachment enabled if

mtagliaferri

Registered User.
Local time
Today, 01:20
Joined
Jul 16, 2006
Messages
528
I have a form with an attachment box, in normal circumstances is not enabled in the form (set a view mode), i have a command button to edit the form with the below code which works perfectly (The Edit resides on the form it self). 'Me.AttachmentsPhotoID.Enabled = True' sets the attachement to be enabled.
Code:
Private Sub CmdEdit_Click()
    Me.Form.AllowEdits = True
    Me.FirstName.SetFocus
    Me.CmdEdit.Visible = False
    Me.AttachmentsPhotoID.Enabled = True
    Me.sfrmPSATimeline.Form.AllowEdits = True
    Me.sfrmPSATimeline.Form.AllowAdditions = True
End Sub

I need now to be able to add an attachment if I am creating a new record, I have a command button which is sitting on another form which will open the relevant form which worked fine till I added the 'Forms!frmPSA!AttachmentsPhotoID.Enable = True'
Code:
Private Sub CmdAdd_Click()
    DoCmd.OpenForm "frmPSA", acNormal, "", "", acAdd
    Forms!frmPSA!CmdEdit.Visible = False
    Forms!frmPSA!AttachmentsPhotoID.Enable = True
    Forms!frmPSA!FirstName.SetFocus
    Forms!frmPSA!sfrmPSATimeline.Form.AllowAdditions = True
End Sub

I get the error 'Run-time error '438'; Object doesn.t support this property or method'
Screenshot 2024-10-06 084118.png


Any thoughts?
 

Users who are viewing this thread

Back
Top Bottom