Another focus() question

When I do some processing after a user input, and I want to evaluate and move focus to the next desired input, I often haave to pu in 1/10 second of delay to get the focus to take. See the below. If I take out the time.sleep(0.1), the foxus ends up back on the original input field if on the browser, it ends up somewhere where I'm not sure it is in the designer.

Am I doing something wrong?

Thanks

	if currentValue.value == "":
		self.focus()
		return
	self.session.custom.CONT = currentValue.value
	query = """
	<a 100mS query>'"""
	Eaches = system.db.runQuery(query)
	
	self.session.custom.Eaches = Eaches
		
	self.session.custom.FoundEaches =[]
	import time
	time.sleep(0.1)
	self.getSibling("EnterUnit").focus()

Maybe try putting the focus() in an onChange script for self.session.custom.Eaches?