Results 1 to 3 of 3

Thread: [RESOLVED] Add values to combo list box

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Long Island, NY.
    Posts
    353

    Resolved [RESOLVED] Add values to combo list box

    I have a combo list box that has two values 56 and 58. I want to write the look up like this:
    VB Code:
    1. SELECT DISTINCT [FC] FROM tblPSR;

    but I want to be able to put new values in on the form also. Like 59 and 60. And when I put a new value I want it to be pulled up in my combo list box. I think my problem is the data isn't in there and it won't allow me to type it in the combo box on the form because it can't find it. How do I fix this??
    Last edited by vonoventwin; Oct 11th, 2005 at 11:27 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Add values to combo list box

    I'm confused.
    Quote Originally Posted by vonoventwin
    I have a combo list box that has two values 56 and 58. I want to write the look up like this:
    VB Code:
    1. SELECT DISTINCT [FC] FROM tblPSR;
    This has nothing to do with a combo. It is a query run against your database, and I don't see code for doing anything for what you get back.
    Quote Originally Posted by vonoventwin
    but I want to be able to put new values in on the form also. Like 59 and 60. And when I put a new value I want it to be pulled up in my combo list box. I think my problem is the data isn't in there and it won't allow me to type it in the combo box on the form because it can't find it.
    If the new items you want to add to your combo box aren't in your database, then no, you can't query the database and retrieve them. However, you can manually add them to your combo using the .AddItem method. In the same place you run your .Additem code, you could also run code to do an INSERT into your database so they would be there next time.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Long Island, NY.
    Posts
    353

    Re: Add values to combo list box

    Figured it out, thanks!

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