Link to home
Start Free TrialLog in
Avatar of Richard Comito
Richard ComitoFlag for United States of America

asked on

How to setFocus with out closing the Exe.

I have the code below that I would like it to set focus on a radio button if certain criteria’s are met.  But what keeps happening is when i get to the end command the Exe closes.          

         If Me.RadioButton1.Checked = True Then
                MsgBox("You have selected to send a test to LAStageTIX.  You must select HTML format for that action.")
                Me.RadioButton2.Focus()
                End
            Else
                newMail.Body = emailHeader & emailSubscribe & emailFooter
            End If


Thanks for your help.
Avatar of ptakja
ptakja
Flag of United States of America image

The problem is the "End" statement after your focus call.

         If Me.RadioButton1.Checked = True Then
                MsgBox("You have selected to send a test to LAStageTIX.  You must select HTML format for that action.")
                Me.RadioButton2.Focus()
                End  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
            Else
                newMail.Body = emailHeader & emailSubscribe & emailFooter
            End If

Change it to this and you should be good to go.

         If Me.RadioButton1.Checked = True Then
                MsgBox("You have selected to send a test to LAStageTIX.  You must select HTML format for that action.")
                Me.RadioButton2.Focus()
            Else
                newMail.Body = emailHeader & emailSubscribe & emailFooter
            End If
ASKER CERTIFIED SOLUTION
Avatar of ptakja
ptakja
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial