| View previous topic :: View next topic |
| Author |
Message |
dark_syde Newbie
Joined: 04 Feb 2004 Posts: 20 Location: Uk : Hemel Hempstead
|
Posted: Mar 2nd, 2004 06:13 AM Post subject: Database to listbox ? |
|
|
Hello everyone. im stuck on a little problem and I have no idea how to work it out.
This is what I would like to do:
I have a form ' frmJobDatabase ' which has a Data1 control which can seacrh through records that are created by the end user.
I have another form ' frmStage ' which has a listbox on it, ' lstRegistration '
What I would like to do is insert whatever is entered in a certain text box ' txtReg ' from the form ' frmJobDatabase ' into the list box ' lstRegistration ' on the form ' frmStage '
How would I go about it ?
Thankyou |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Mar 3rd, 2004 09:19 AM Post subject: |
|
|
To enter the value of a textbox in a listbox you can do :
[vb:1:4c9e4f5ca2]ListBox.AddItem TextBox.Text[/vb:1:4c9e4f5ca2]
and just fix the names and specify the forms...
So I guess :
[vb:1:4c9e4f5ca2]frmStage.lstRegistration.AddItem frmJobDatabase.txtReg.Text[/vb:1:4c9e4f5ca2]
However, I don't think that is what you want exactly... Could you explain a little more?
Thanks _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
dark_syde Newbie
Joined: 04 Feb 2004 Posts: 20 Location: Uk : Hemel Hempstead
|
Posted: Mar 3rd, 2004 03:36 PM Post subject: |
|
|
That does exactly what I wanted. I guess I shold have mentioned this part in the earlier post but now that I can enter text into the listbox, how can I get it to save all items that are inside the listbox because everytime I close the form they all dissapear.
Thankyou for your reply P.T.A.M |
|
| Back to top |
|
Avis Junior Poster

Joined: 07 Oct 2003 Posts: 510 Location: India
|
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Mar 6th, 2004 04:27 PM Post subject: |
|
|
You can use the SaveSetting and GetSetting functions to save and get data from the registry Or you can always save to a file and load back. Or an ini file. Are you familiar with these options? If you need any help, just ask  _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
|