Is it possible to change the event of a button click within different subs? For example, have the button take me to the main menu in one sub, but in another sub have the same button take me somewhere else.
Roldy
0
Newbie Poster
Recommended Answers
Jump to PostYou need to maintain a flag ,and based on the flag value do what ever you want.
Jump to PostDim flag As Integer Private Sub Command1_Click() If flag = 0 Then Flag1 Else Flag2 End If End Sub Private Sub Flag1() MsgBox ("flag 0") flag = 1 End Sub Private Sub Flag2() MsgBox ("flag 1") flag = 0 End Sub
All 6 Replies
debasisdas
580
Posting Genius
Featured Poster
Roldy
0
Newbie Poster
Vineeth K
10
Posting Whiz in Training
Roldy
0
Newbie Poster
debasisdas
580
Posting Genius
Featured Poster
AndreRet
526
Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.