[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:
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??
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:
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.
Re: Add values to combo list box