how to use in access 2010 the method go to control in another form

bill201
bill201 used Ask the Experts™
on
hi


i have some main menu form and i want that some command button in this form when i press on this it's will open another form (SmallExpensesF) and then it's will go to a combo box field (CategorySmallListComboBox) and it's will open the combo list
this is my code:
    DoCmd.OpenForm "SmallExpensesF"
    DoCmd.GoToControl Forms!SmallExpensesF!CategorySmallListComboBox
    Forms!SmallExpensesF!CategorySmallListComboBox.Dropdown3
but i get an error message "run time error 2498 an expression you entered is the wrong data type for one of the arguments"

do some one have an alternative code?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Change your second statement to
Forms!SmallExpensesF!CategorySmallListComboBox.SetFocus
Jeffrey CoachmanMIS Liason
Most Valuable Expert 2012

Commented:
I only use GoToControl when I am moving to a control on the same form.

If I am moving the focus to a control on another form I do something like this:
    DoCmd.OpenForm "SmallExpensesF"
    me.CategorySmallListComboBox.setFocus
    me.SmallListComboBox.Dropdown

Author

Commented:
thanks a lot for you both but boag me. don't work in another form

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial