Thanks for Answering Brother.
Your answer does work.
But when I make a the subroutine with a default value of Nothing and when I run the program it runs correctly only if i gave all the arguments including optional values. If i miss only one optional argument it gives the error that Object Reference not set to an instance of object.
Here is my subroutine.
Private Sub ActivateControls(rd As RadioButton, Optional txt As TextBox = Nothing, txt2 As TextBox = Nothing)
End Sub
When I called this subroutine in my program as
ActivateControls(rdbtn,txt)
It gives me the following error
"Object Reference not set to an Instance of an Object"
But when I write this subroutine as
ActivateControls(rdbtn,txt,txt2)
It works right.
So, Please tell me what is the solution of this problem.
OR
Is there any other value Except Nothing That I can set as Default value of Optional controls(like textbox, combobox)