Open Attachment Screen

Trachr

Registered User.
Local time
, 20:50
Joined
Jun 1, 2014
Messages
90
Hello, Im trying to open the attachment menu that you get for clicking on the paperclip and such via code... I want it to open basically when I press a button

Ive tried:

Private Sub picture_Click()
Me.SeriesPicture.SetFocus
RunCommand acCmdManageAttachments
End Sub

But its telling me method or datamember not available so Im guessing Im doing something wrong... hopefully its a simple dumb mistake lol

Also while Im here Ill ask, is there a way to via vba make an attachment screen in a form invisible?

Basically what Im doing is setting up a form so it wont be visible at all when there is no attachment, but when there is a picture, It pops up on the form

Thanks.
 
wow that was fast my next try got it so that first question is done... answer was:

Private Sub picture_Click()
DoCmd.GoToControl "SeriesPicture"
DoCmd.RunCommand acCmdManageAttachments
End Sub
 
ok sorry about the thread that I solved myself... just figured that out too... that was more simple then I realized... the first I think I got lucky figuring out... in case anyone was wondering the answer on the 2nd was this:

Me.Picturescreen.Visible = False

Nothing I hate more then when I find a thread with my exact question and someone says they figured it out and never says how lol
 
this is the code I used to achieve what I was talking about above... if anyone sees something horrible please speak up lol

Private Sub Form_Load()
If IsNull(Me.SeriesPicture) Then
Me.InsideWidth = 5700
Me.Picturescreen.Visible = False
Else
Me.InsideWidth = 10260
End If
End Sub

Private Sub picture_Click()
DoCmd.GoToControl "Picturescreen"
DoCmd.RunCommand acCmdManageAttachments
End Sub
 
Ok running that didnt work since when I made my attachment element invisible I couldnt access it causing an error if I ever wanted to click the button to add a picture... I solved thsi by adding a 2nd attachment element into the form also linked to the same place, however I made this one tiny 0x0 to be exact with a white border so it was invisible... but it was there in the mind of access so that worked for me. I redirected the button to focus on that element allowing me to put my main attachment element where I wanted and how I wanted since I could make it invisible when I didnt want it seen

here is my 2nd code:

Private Sub Form_Load()
If IsNull(Me.SeriesPicture) Then
Me.InsideWidth = 5700
Me.Picturescreen.Visible = False
Else
Me.InsideWidth = 10260
End If
End Sub

Private Sub picture_Click()
DoCmd.GoToControl "Picturescreen2"
DoCmd.RunCommand acCmdManageAttachments
End Sub
 

Users who are viewing this thread

Back
Top Bottom