General information
Category:
Forms & Form designer
Title:
Listbox in grid problems
Help! Can somebody tell me what am I missing here?
I have a grid which has two related columns, the second is a listbox.
I am trying to set the rowsource of the listbox programmatically in it's dropdown event. The values in the list are determined by the value of the first field in the same row.
cboPayors.dropdown
LPARAMETERS nindex
*-- create a cursor for the Payor drop-down list of Owners of this Folio
lcFolio = THIS.parent.parent.column2.txtFolio_id.value
IF NOT EMPTY(lcFolio)
THIS.RowSource = ;
"SELECT F.OWNER_ID, O.LAST_NAME, O.FIRST_NAME FROM FOLIOOWNER F, OWNER O " + ;
"WHERE F.FOLIO_ID= '" + lcFolio + "' AND " + ;
"F.OWNER_ID=O.OWNER_ID INTO CURSOR cPayors NOFILTER"
=messagebox(this.RowSource)
ENDIF
From the messagebox, I can see that the value of txtFolio_Id being used to build the SELECT statement is NOT that of the currently selected row, but that of the previously selected row, despite the record mark indicating the current row.
How do I ensure I am using the value of the Folio_Id field which is on the same row as the listbox just clicked ??
A related Q - in some examples of drop-down lists I've seen, clicking on the field causes the list to drop, in others the use has to click on the down arrow. What is causing this difference in behaviour?
TIA for any suggestions,
Martyn Thomson
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only