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

Passing data to a listbox in another form

Status
Not open for further replies.

funkyyuzzam

Programmer
Aug 12, 2002
10
GB
Can anyone help, Im a bit confused her.

I need to send the data below to a list box on another form rather than just printing it to the form itself. I can't for the life of me work out how to do this.

Here is the doe that i have written to print staright to the form, but this is crap!.



frmTrainingPlan.Print Date & Space(12); "Endurance " &_ Training & " Hours"
frmTrainingPlan.Print Date + 1 & Space(12); "Intensity " & _IntTraining & " Hours



So rather than print it to frmTrainingPlan, how do I get it to display in a list box?

Any help appreciated.

Thanks


Funky
 
Its Ok

I sussed it.

Just for interest, I left out the space(12) and just coded

.AddItem Date & "Endurance " &_ Training & " Hours"


this works. i assume the list box didnt understand the space bit.

Thanks for your help
 
It understood the space bit: but it won't understand the semicolon bit. To concatenate strings use & Let me know if this helps
________________________________________________________________
If you are worried about how to post, please check out FAQ222-2244 first

'There are 10 kinds of people in the world: those who understand binary, and those who don't.'
 
The problem isn't with the Space() function. This isn't a print statement, so you can't use the semi-colon. You must create a string using the ampersand (&) for concatenation. Just replace the semi-colon with an ampersand. Also, be careful with the underscores. They won't work like you have them. If you are using them for line continuation, they must be preceded with a space. I assume you have declared variables named Training and intTraining.

tbuch
 
Thanks Guys

Yes tbuch, i declared the variables and have now tried all the advice. It all works fine.

Funky
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top