jardenp
Active Member
- Joined
- May 12, 2009
- Messages
- 373
- Office Version
- 2019
- 2016
- 2013
- 2011
- 2010
- Platform
- Windows
I'm new to forms, so I have two basic questions that I can't find the answer to.
1) I have a form Report_All_Specific that asks users if they want to run a report for all employees or specific employees. The form consists of a question and two command buttons named All_Active and Specific. I know how to call the form, but where can I put my code that corresponds to each button? I'd rather not have the buttons call separate subs if possible--I'd rather just have the code in the original sub. The logic would be something like:
Sub EE_Reports
Report_All_Specific.Show
If All_Active is clicked then
remainder of macro code (that executes no matter which button is clicked)
End Sub
and 2) I want to have a form with three command buttons (say CB1, CB2, and CB3). If CB1 is clicked, variable X is set to 1, if CB2 then X is set to 2, and if CB3 then X is set to 3. How do I do this and would that code go in the Sub that calls the form or in the form itself?
Thanks!
Josh in IN
1) I have a form Report_All_Specific that asks users if they want to run a report for all employees or specific employees. The form consists of a question and two command buttons named All_Active and Specific. I know how to call the form, but where can I put my code that corresponds to each button? I'd rather not have the buttons call separate subs if possible--I'd rather just have the code in the original sub. The logic would be something like:
Sub EE_Reports
Report_All_Specific.Show
If All_Active is clicked then
action 1
If Specific is clickedaction 2
End command button-related coderemainder of macro code (that executes no matter which button is clicked)
End Sub
and 2) I want to have a form with three command buttons (say CB1, CB2, and CB3). If CB1 is clicked, variable X is set to 1, if CB2 then X is set to 2, and if CB3 then X is set to 3. How do I do this and would that code go in the Sub that calls the form or in the form itself?
Thanks!
Josh in IN