Results 1 to 3 of 3

Thread: Combo Boxes

  1. #1
    Guest
    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)


  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Oshkosh, WI
    Posts
    163

    Cool

    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..


  3. #3
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374

    Wink

    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
  •  



Click Here to Expand Forum to Full Width