Skip to main content

Selecting checks via radiobuttons

Hi all,
I am trying to put together a script that lets me run a selected check on based on the appropriate VAT category by using radiobuttons. I tried basing the script on the one in the instructional video on this site, though i'm stuck at the radio buttons.
Can someone please give me some pointers as to how i can continue my script? The goal is that i can link a function to each of the selected radioboxes. I got to the part where i can select a file from the explorer to do my checks on, but now i need to assign checks to each of the radiobuttons. If i add extra case select numbers, it doesn't seem to link to any of the radioboxes, so there's probably some other way, but i have no idea how... :-)
The script is added as an attachment.
Best regards,
Dennis
 
 
 

Brian Element Tue, 12/09/2014 - 19:02

Hi Dennis,

I updated your script with a variable for radioButton to hold the contents of the radio button.  When you click on the ok button the script will capture the value of the radio button in the radioButton.  So the variable will hold 0 if the first items is selected, 1 for the next, 2 after that and so on.  You then can use a select case statement to do something with the variable.

Hope this helps.

Brian

 

Dennismes Wed, 12/10/2014 - 06:23

Awesome, thanks!
I now added select case radiobutton after the first select case is ended, and messageboxes to check the outcome. However, there are two things i can't seem to fix. When i press cancel it ends the dialog but also shows the messagebox for the selected radiobox instead of killing the dialog, meaning that the test is run even if i cancel the dialog. Also, when I select a database it immediately starts running the selected radiobutton messagebox without me having to press "OK" first. 
Is there a way to make the script hold all further actions until i press the OK button and not run functions when i press cancel or select a database? I added the latest version in the attachment. 
Best regards,
Dennis

Brian Element Wed, 12/10/2014 - 07:37

In reply to by Dennismes

Hi Dennis,

I fixed the problem with the radio button, what you need to do is put it under the select case for the ok button so that it only runs when the person selects ok.  This also fixes the problem with the cancel and the select file option.

Let me know how it goes.

Brian

Dennismes Wed, 12/10/2014 - 08:49

Thanks a lot, you rock! :-)
I'll continue working on it asap and i'll definetely let you know how it goes.
Gr,
Dennis

Dennismes Thu, 12/11/2014 - 10:56

It's as good as done! :-). All that remains now is validating and to see if my colleagues can actually use it too, but it's definetely going to save a lot of work. Thanks again for all the help!
Dennis