Subform + Setfocus


T

TaylorGaffney

I have a main form, which contains mulitple subforms. I have the end
users clicking on a command button to proceed to the next
section(subform). I need the focus to be set to the firt text box in
the subform. I seem to have the code right or so I think but it seems
to keep the focus on the first subform instead of proceeding the next
subform and setting the focus on the first text box.

The code.....

Private Sub gotoSecB_Click()
Dim Response As Integer, shellexecute As Control
Dim rtn
rtn = CheckFormR(Me)
If Not IsNull(rtn) Then
MsgBox rtn
Exit Sub
End If
If MsgBox("Is there an address change?.", vbQuestion & vbYesNo) =
vbYes Then
Forms![form1]![frm sectionB].SubForm![Address].SetFocus
Else
Forms![form1]![frm sectionC].SubForm![InsuranceCo].SetFocus
End If

End Sub

Any suggestions?

Thanks in advance
 
Ad

Advertisements

G

George Nicholson

Its a 2 step process: set focus to the subform, then setfocus to the
control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top