Re: SetFocus after IsLoaded returns true

Tech-Archive recommends: Speed Up your PC by fixing your registry



Set the focus to a control on the form.
--
hth,
SusanV

"TIm Rush" <TImRush@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3F4DC5E9-C585-4422-8A3F-6A0D17081FDF@xxxxxxxxxxxxxxxx
After checking the form is loaded, I get an error trying to set the focus
to
the open form. (Runtime error 438, object doesnlt support this property or
method.) Debug brings me to the setfocus line.

Private Sub Return_Click()
If IsLoaded("pgMain") = True Then
Forms![pgMain].SetFocus
Else
DoCmd.OpenForm "pgMain", acNormal
End If
DoCmd.Close acForm, Me.Name
End Sub



.