General information
Category:
Forms & Form designer
Try setting DisplayValue property of the Combo with your desired value. I beleive it must exist in the drop-down selection set, though...
HTH
>I am trying to set a combobox.value to a value which is looked up and returned from another table. I would like it to be displayed on the screen automatically, instead of it being empty.
>
>For example, in the Sales Order file I have a field named "cBillToID".
>Upon loading any sale order (previously entered), I would like to lookup that "cBillToid" field in the "CUSTOMER_BILLTO" table and return and display the returned "cCode" in the combobox (value) named "cboBillToCode" on the saleorder form.
>
>My problem is that upon loading any sales order my combo box (default value) is empty.
>
>I attempt the same thing to return the "cName" into a text field on the Sales Order form it works great. Is there a diffence with "text" fields and "combo" boxes in storing a value?
>
>I am not talking about the actuall drop down list. That is fine. That is a SELECT from the CUSTOMER_BILLTO table. That works ok.
>
>Following is my code from within the Sales Order form.
>============================================================================
>LOCAL llSkipSeek
>WITH THISFORM.pgfData.pgEntry
>
>llSkipSeek =THIS.oCurrentData.EOF() OR ( THIS.oCurrentData.TableIsEmpty() ) OR THIS.oCurrentData._lAddMode
>
>IF NOT llSkipSeek
> =SEEK(THIS.oCurrentdata.FieldGetValue("cBillToID"), "CUSTOMER_BILLTO")
>ENDIF
>
>.txtcBillToName.Value= IIF(NOT llSkipSeek, CUSTOMER_BILLTO.cName, SPACE(LEN(CUSTOMER_BILLTO.cName)))
>.cboBillToCode.Value= IIF(NOT llSkipSeek, CUSTOMER_BILLTO.cCode, SPACE(LEN(CUSTOMER_BILLTO.cCode)))
>
>ENDWITH
Previous
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