PurpleUnicorn
Programmer
I have a search form from which I open a detail form using the search criteria.
If there are records in the detail form, all is well and the form opens - placing my criteria in an unbound textbox.
I have code in the got focus event of the unbound textbox to place the cursor at the end of the string:
if len(me.txtSearch) > 0 then
Me.txtSearch.selstart = len(me.txtSearch)
end if (this works find if there are records)
If there are no records - an error is generated
"You can't reference a property or method for a control unless the control has the focus."
I am quite confused since this is all happening in the controls Got Focus event.
Any insight will be greatly appreciated.
If there are records in the detail form, all is well and the form opens - placing my criteria in an unbound textbox.
I have code in the got focus event of the unbound textbox to place the cursor at the end of the string:
if len(me.txtSearch) > 0 then
Me.txtSearch.selstart = len(me.txtSearch)
end if (this works find if there are records)
If there are no records - an error is generated
"You can't reference a property or method for a control unless the control has the focus."
I am quite confused since this is all happening in the controls Got Focus event.
Any insight will be greatly appreciated.