vba - Pass variable into button_click procedure -
is possible pass variable button_click procedure?
background:
i have 2 procedures, both of perform actions, , both open form_1. now, dependant on procedure opened form_1, want command button perform different task data on form. ordinarily, pass variable first procedure procedure being called.
however, due being form being called, requires user click command button initiate second procedure, not think it's possible pass variable procedure?
for assign public variable in procedure_1: override = false
, procedure_2: override = true
, know it's frowned upon use public variables (from have read).
within button_click procedure use variable route code accordingly.
private sub commandbutton1_click() if override call override_data else call submit_data end if end sub
am okay, in scenario, use public variable? or there better way achieve target?
i ended reading jon peltier's article on user form properties, suggested in comments @petert.
this enabled me use user form property instead of public variable.
Comments
Post a Comment