One command button, two commands (1 Viewer)

Mahall906

New member
Local time
Today, 20:35
Joined
Apr 11, 2014
Messages
23
Still getting used to codes and would like a command button to do two things, tick a box and run a command to insert a hyperlink.

I have plenty of separate ones doing these for other things but how do I join the two in one click command?

When the "Email" button is pressed I would like it to mark checkbox "Email2" and to RunCommand acCmdInsertHyperlink for "report" text box.

Two examples of them separate are:

Private Sub Email1_Click()
Me.Email2 = True
End Sub

that sorts out the checkbox

Private Sub Email1_Click()
Me.[report].SetFocus
On Error GoTo browse_stop
RunCommand acCmdInsertHyperlink
browse_stop:
End Sub

does the hyperlink request.

Thanks in advance
 
Last edited:

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:35
Joined
Aug 30, 2003
Messages
35,749
Just put them together in one sub:



Private Sub Email1_Click()
Me.Email2 = True
Me.[report].SetFocus
On Error GoTo browse_stop
RunCommand acCmdInsertHyperlink
browse_stop:
End Sub
 

Mahall906

New member
Local time
Today, 20:35
Joined
Apr 11, 2014
Messages
23
What on earth have been doing then!?:rolleyes: ha ha in honesty I waiting for there to be something in between the two! Thanks pbadly(y)
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:35
Joined
Aug 30, 2003
Messages
35,749
Happy to help!
 

Users who are viewing this thread

Top Bottom