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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pick up value from combobox

Status
Not open for further replies.

bharons

Technical User
Jan 23, 2019
29
ID
hello experts...
I have a combobox containing data which is a column of a table.
So far I have used code like this:
Code:
Public     column_name, column_name1, column_name2, column_name3, column_name4, ;
        column_name5, column_name6, column_name7, column_name8, column_name9
if     empty(thisform.text3.value)
    column_name = crsresult4.column_name
endif
if     not empty(thisform.text3.value) and empty(thisform.text4.value) ;
    AND thisform.text3.value <> this.value
    column_name1 = crsresult4.column_name
endif
if     NOT empty(thisform.text3.value) and NOT empty(thisform.text4.value) ;
    AND empty(thisform.text5.value) and thisform.text3.value <> this.value ;
    and thisform.text4.value <> this.value
    column_name2 = crsresult4.column_name
endif
if     NOT empty(thisform.text3.value) and NOT empty(thisform.text4.value) ;
    and NOT empty(thisform.text5.value) AND empty(thisform.text6.value) ;
    and thisform.text3.value <> this.value and thisform.text4.value <> this.value ;
    and thisform.text5.value <> this.value
    column_name3 = crsresult4.column_name
endif

thisform.text3.value = column_name
thisform.text4.value = column_name1
thisform.text5.value = column_name2
thisform.text6.value = column_name3

and I can change some textboxes. In here I want to replace the textbox with initials, can this be implemented? I try this code but it seems only one textbox can be change.

Code:
Public     column_name, column_name1, column_name2, column_name3, column_name4, ;
        column_name5, column_name6, column_name7, column_name8, column_name9
*if     empty(thisform.text3.value)
*    column_name = crsresult4.column_name
*endif
*if     not empty(thisform.text3.value) and empty(thisform.text4.value) ;
    AND thisform.text3.value <> this.value
*    column_name1 = crsresult4.column_name
*endif
*if     NOT empty(thisform.text3.value) and NOT empty(thisform.text4.value) ;
    AND empty(thisform.text5.value) and thisform.text3.value <> this.value ;
    and thisform.text4.value <> this.value
*    column_name2 = crsresult4.column_name
*endif
*if     NOT empty(thisform.text3.value) and NOT empty(thisform.text4.value) ;
    and NOT empty(thisform.text5.value) AND empty(thisform.text6.value) ;
    and thisform.text3.value <> this.value and thisform.text4.value <> this.value ;
    and thisform.text5.value <> this.value
*    column_name3 = crsresult4.column_name
*endif

local a, b, c, d
a = ''
b = ''
c = ''
d = ''
if     a = ''
    a = crsresult4.column_name
endif
if     a <> '' and a <> this.value and b = ''
    b = crsresult4.column_name
endif
if     a <> '' and a <> this.value and b <> '' and ;
    b <> this.value and c = ''
    c = crsresult4.column_name
endif
if     a <> '' and a <> this.value and b <> '' and ;
    b <> this.value and c <> '' and c <> this.value ;
    and d = ''
    d = crsresult4.column_name
endif

thisform.text3.value = a
thisform.text4.value = b
thisform.text5.value = c
thisform.text6.value = d

notes :
all textboxes are just a sign that the data I selected from the combobox can be used, for example:

Code:
TEXT TO m.lcSQL TEXTMERGE noshow
    UPDATE << TRIM(crsTables.TableName) >>
    SET << m.lcColumnname1 >> = ?m.lcValue1
    WHERE << m.lcColumnname >> = ?m.lcValue
ENDTEXT

to define which column reffer to lcColumnname, lcColumnname1 and so on?

Ikon Diverifikasi Komunitas
 

Attachments

  • 1724733338481.png
    1724733338481.png
    312 bytes · Views: 2
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top