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!

How can I input data via Combobox use code?

Status
Not open for further replies.

andrewz

Technical User
Oct 31, 2000
1
0
0
ID
How can I input data such as 'Gender' via Combobox (ex :'A' for Male and 'B' for Female)?
The Combobox has 2 colums, first for the code ('A'and 'B'), the second one for the items ('Male' and 'Female') and This Combo will display the items.
 
AndrewZ,

In the combo's Requery method put this code;

WITH This
.Clear()
.AddListItem("A",1,1)
.AddListItem("Male",1,2)
.AddListItem("B",2,1)
.AddListItem("Female",2,2)
.ColumnCount = 2
ENDWITH



JimBooth
jbooth@jamesbooth.com
 
You could also make the row source an array. You can add rows to the array by redimensioning the array:

for example:

LOCAL llRetVal

llRetVal = DODEFAULT()

IF llRetVal
WITH THIS
DIMENSION .aChoice[4,2]
.aChoice[1,1] = "Very bad"
.aChoice[1,2] = "3"
.aChoice[2,1] = "Bad"
.aChoice[2,2] = "2"
.aChoice[3,1] = "Good"
.aChoice[3,2] = "1"
.aChoice[4,1] = "very good"
.aChoice[4,2] = "4"

.BOUNDCOLUMN = 2
.ROWSOURCETYPE = 5
.ROWSOURCE = "THIS.aChoice"
ENDWITH
ENDIF

RETURN llRetVal
Weedz
veld4663@exact.nl

'It never hurts to help...' - Eek the cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top