Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot get focus on listbox

Status
Not open for further replies.

CJMK

Programmer
Jul 2, 2014
30
US
Created simple listbox with rowsource and controlsource,one column. It populates from the table of 395 records, but cannot receive focus. Tabbing just skips it. Only three objects on form, others are command buttons included in the class.
Combobox with same controlsource (record ID, a 5 digit integer not autoincrement) and rowsource does not populate and is grayed out.

I have tried sourcetypes 2 and 6 to no avail

I have made many of these before without this issue.
Feels like I am stupidly forgetting something simple, but what?
TIA
 
Mike,
Thanks for responding so quickly.

Both the form and object are fresh out of the box. All settings are default except for control source and row source. adding a combo and screenshot to show, since I think the two issues must be connected somehow. The Combo does get focus, but does not populate. The listbox populates but does not get focus. control source, rowsource and rowsourcetype (alias) are the same for both. I tried fields too, but same result.
 
 https://files.engineering.com/getfile.aspx?folder=e563b918-11a8-4eb4-9e7c-7f0b0ce1cd28&file=2022-07-18_(1).png
control source, rowsource and rowsourcetype (alias) are the same for both

That might be the root of the problem. Can you try applying different sources for one of the controls, and see if the problem goes away?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,
I think I found the answer. I tried an array with no success. The field I was using is integer. On a hunch I switched to character type and all returned to normal.
Thanks for your attention - and it did push me in the right direction.
Of course I am curious as to why they don't like numbers; but that's a question for another time. I'm in a rush right now, so anything that works works.

Thanks for being there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top