set focus

  • Thread starter Thread starter RHG
  • Start date Start date
R

RHG

I have a combo box that gets populated with the index
fields. This is done to limit the search capabilities. In
order to do a docmd.findrecord I first need to set the
appropriate field with a .setfocus statement. The question
is how can i set focus to the selected value of the combo
box? I have tried combobox.value.setfocus but it did not
work.
 
RHG said:
I have a combo box that gets populated with the index
fields. This is done to limit the search capabilities. In
order to do a docmd.findrecord I first need to set the
appropriate field with a .setfocus statement. The question
is how can i set focus to the selected value of the combo
box? I have tried combobox.value.setfocus but it did not
work.

Me.Controls(combobox).SetFocus

and since the controls collection is the default for a form, you can
also use

Me(combobox).SetFocus
 
I get a runtime error 438.
Object doesnt support this property or method

me.controls(cbo).setfocus

where cbo is the name of the combobox
 
RHG said:
I get a runtime error 438.
Object doesnt support this property or method

me.controls(cbo).setfocus

where cbo is the name of the combobox

And what is the value of cbo at the time the error occurs? Likely the
name of a control that doesn't support SetFocus
 
Back
Top