By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,384 Members | 671 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,384 IT Pros & Developers. It's quick & easy.

runtime error 2110 can't move focus

P: n/a
I have a combo box in which a user can select a number of "1" or "0".
if the user selects "1" it changes the visible property on other
controls that were initial set to "Flase" to "True" .

the code works until i added the set focus.

why do i get this the runtime error? it says it cannot move the focus
to the control.

the cboVehicleLog IS enabled and NOT locked

here is my code:

If tester = "1" Then
cboVehicleLog.Visible = True
cboFleet.Visible = True

cboVehicleLog.SetFocus
End If

Aug 7 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

pa*******@gmail.com wrote:
I have a combo box in which a user can select a number of "1" or "0".
if the user selects "1" it changes the visible property on other
controls that were initial set to "Flase" to "True" .

the code works until i added the set focus.

why do i get this the runtime error? it says it cannot move the focus
to the control.

the cboVehicleLog IS enabled and NOT locked

here is my code:

If tester = "1" Then
cboVehicleLog.Visible = True
cboFleet.Visible = True

cboVehicleLog.SetFocus
End If
Hmmm, a couple of wild guesses without seeing everything else...

Is the name of cboVehicleLog the name of your control *and* your
datasource? If thats the case then VBA will have some issues as to
which it's addressing. The cbo prefix you have on there probably
indicates this isn't the issue.

Also, when exactly are you changing the cbovehiclelog field to
invisible? You said that it was initially set to false, but I don't see
the 'Else cboVehiclelog.visible = false statement. Do you have that
somewhere else? Are you SURE the error is occuring at the INSTANT you
set the fields focus or is it perhaps at a different time, say a time
when you set the cboVehicleLog to invisible? An invisible field can't
have the focus.

My 2cents

Aug 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.