|
-
Oct 5th, 2008, 11:38 PM
#1
Thread Starter
New Member
[2008] Clear radiobuttons in groupbox
Hi there,
Basically, my form has 5 groupboxes with 4 radiobuttons in each groupbox, and I also have 3 textboxes. I have a button in the form in which I can go back to the main screen, and likewise, a button in the main screen to go back to this form.
So when I select the radiobuttons in the groupboxes, and i clicked the main screen, and back to the form, it will clear all selections, including the textboxes. I was able to do that, but if I didn't select any of the radiobuttons, and I clicked the main screen button, it will have an error. "Object reference not set to an instance of an object."
Code:
Me.RadioButtons.Checked = False
Me.RadioButtons1.Checked = False
Me.RadioButtons2.Checked = False
Me.RadioButtons3.Checked = False
Me.RadioButtons4.Checked = False
This is part of my code in the Main Screen button.
Any idea how? Thanks.
-
Oct 6th, 2008, 01:13 AM
#2
Re: [2008] Clear radiobuttons in groupbox
That error message has nothing to do with that code. When the exception is thrown the IDE will tell you exactly what line the exception was thrown on. You then need to use the debugger to test each reference on that line to see which is null, i.e. Nothing. You then need to work back through your code to the point where you expected an object to be assigned to that reference and determine why it wasn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|