.dropdown question

motleyjew

Registered User.
Local time
Today, 16:15
Joined
Jan 11, 2007
Messages
109
I am having a small issue with using the .dropdown command. I am using a combobox as a search tool with the code Me.combo107.dropdown in the On Change Event. I am using the Not In list property set to yes to trigger a custom message box stating that the number is not a valid project. If the project is on the list and you hit the enter key, code in the after update event sets the focus to another field on a seperate tabbed page.This works fine if you hit enter to select the project. The problem I am having is when a project that is on the list is selected using the mouse click instead of hitting enter, the focus is set properly to the next page, but I get the following error: Run time error '2185' . You can't reference a property or method for acontrol unless the control has the focus.

I was able to get it wo work better by putting the me.combo107.dropdown code on the Keypress event. The problem I have with this method is that if the code is not on the list, the dropdown box covers the custome error message that is triggered in the not in list event. I tired doing some setfocus code before the message box triggers, but it doesn't seem to want to move. Any help would be much appreciated.
 
I use the Got Focus event to drop down the list. With the change or keypress event, it's running again with every keystroke, which isn't necessary.
 
Thanks Paul for the tip. I tried the got focus as well, but I'm not that crazy about the drop down being open every time i go to this page.I like to assume that they are using this field a majority of time,so when the database opens, the focus is automatically set to the search field. It's a good option. Maybe I just won't set the focus to the field as a work around. Thanks again
 

Users who are viewing this thread

Back
Top Bottom