>Hi Dorris,
>
>1. Add NOFILTER at the end of your select (you can also probably just use one variable for your WHERE condition).
>
>2. I prefer to use RowSourceType = 'Cursor" and only select the columns I need. That's personal preference, but I found cursor type to work best for combos.
>
>>Hey Happy Peoples
>>
>>I've got the following coming out of a LostFocus on a textbox
>>
>> Select * From Officer ;
>> WHERE Alltrim(Upper(LASTNAME))+Alltrim(Upper(FIRSTNAME)) = Alltrim(Upper(lname)) + Alltrim(Upper(fname)) ;
>> INTO Cursor Countit
>> thisform.lblSelectPerson.Visible = .t.
>> WITH thisform.cboSelectPerson
>> .RowSourceType = 6
>> .RowSource = "Countit.lastname, firstname, DOB, empcnty"
>> .ColumnCount = 4
>> .ColumnWidths = '150,150,75,150'
>> .visible = .t.
>> .ListIndex = 1
>> ENDWITH
>>
>>
>>Now, this is the same code (with different form element names, of course) I'm using in several places within this application. The problem is that the combobox is showing blank, and there is nothing to 'drop down'. Why is this combobox not behaving like the others?
Dorris,
The rowsource of your combobox is fields, however your cursor Countit has no field lastname, also I dont think you can combine the fields of your table Officers (firstname, DOB and empcnty ) just like that in your combo.rowsource.
The select statement in your textbox.lostfocus also puzzles me : Select * From Officer ;
WHERE Alltrim(Upper(LASTNAME))+Alltrim(Upper(FIRSTNAME)) = Alltrim(Upper(lname)) + Alltrim(Upper(fname)) ;
INTO Cursor Countit
where have you defined the locals lname and fname?
And why do you code/instantiate your combo box in the lostfocus of a textbox? Instantiate it in the combobox I would say.
What do you expect to see / with what data should your combobox be populated?
Regards,
Koen