|
-
Apr 25th, 2000, 10:28 PM
#1
I'm using this code here to add to a combo box. The txtCompany is on a different form than the cmbCmpName. The problem is when I shut the program down it does not keep the data in the program when I run it again.
Here is the code I'm using
TimeSheet.cmbCmpName.AddItem (txtCompany.Text)
-
Apr 25th, 2000, 10:34 PM
#2
Addicted Member
Data that is loaded into controls at run time will disappear once the program is stopped. If you want the information to reload into the application you need to store it somewhere. In a file, the registry, database, etc..
-
Apr 25th, 2000, 10:38 PM
#3
Hyperactive Member
That's because you are populating the combo box on the fly, as in you are adding the company name to the combo box with code rather than adding the company name to a table or other record source.
If you want to store the company name that your user enters for future use, you need to have a table with a list of the names, and have the table as the combo box's data source. Then when your user enters a company, add it to the table rather than adding it directly to the combo box.
If that sounds greek, send me an email and I can try to send you an example.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|