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 TouchToneTommy 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 display two fields in list box

Status
Not open for further replies.

muraliambt

Programmer
Jan 22, 2002
75
US
I want to disp two fields in listbox. this two fields i
want to create during runtime and how can save this two fields value to variable when i exit the listbox.

Murali.
 
HI

1. Now to get the field values to the variables..

myVar1 = alias.myField1
myVar2 = alias.myField2

2. To display two field values in a list box..

myTextBox.ControlSource = ;
myVar1+myVar2

In the above example, it is assumed myField1 and myField2 are text fields. If they are numeric .. then..
ALLT(STR(myField1))+ALLT(STR(myField2))

3. To save the values, in the lost focus event of the Text Box..
myVar1 = SUBSTR(This.Value,nCharacters,1)
myVar2 = SUBSTR(This.Value,nCharacters,1+LEN(myField1))
REPLACE alias.myField1 WITH myVar1.. etc...

Hope this helps you :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
muraliambt

Ramani's answer is specific to a textbox, and it may well be the question you intended to ask - if so you have an answer.

You did specifically mention listbox twice in your post, and concatenating the values selected from a listbox would not make any sense.

Perhaps you could clarify your question?

Chris :)
 
Hi chris,

U are right, i want it for listbox not text box.

Murali.

 
Murali-

You may want to look at the following threads:

184-184930
184-183514

In particular the latter thread; a complete example you can work from.

Jack
 
HI Chris.. I have been silly.. reading a list box as text box and writing it as list box.. you are right.. I must have been zzzzzzzzzzzzzzzz at that time.. huh.. :-( ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
ramani

With great foresight, you provided the right answer to the wrong question, which ultimately turned out to be the right answer to the right question!

I simply never ever get that lucky!

Chris :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top