bring up dialog box from command button?

  • Thread starter Thread starter Xtreme Hammer Action
  • Start date Start date
X

Xtreme Hammer Action

Hi

I have a sheet with some command buttons on and was wondering if i can call
up a dialog box with say 5 options on, which in turn open a corrospending
sheet.

example:

a frontpage with 4 options, when 1 is selected a form pops up with 5 other
options on. whn one of these is clicked a sheet is then opened.


Can I do this? is it possisble?

Thanks in advance for th help.
 
Yes it is possible and there are a couple of was to do this. The simplist is to design a form, (i simply call it frm1) and insert a frame
Then insert 4 optionbuttons in the frame. (or however many you want
You don't really need the frame but it is good practice and you will need it if you ever want to expand a form to have many different options using option buttons.

In the On_Click event for each OptionButton insert this cod

frm1.hide 'This is the main form. This closes it so that the desktop doesn't get cluttere
frm2.show ' This is the name of the form that you want to open when that particular option button is selecte

You can repeat this as many times as you like on as many forms. in the situation you describe you will need to insert the code from your origional Command buttons into the On_Click events of the option buttons on the second form. eg:

sub OptionButton1_Click(

Sheets("Name of Sheet").activat

end su

hope this help
 
Back
Top