Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box (style 2) adding from database after load

Status
Not open for further replies.

HebieBug

Programmer
Jan 8, 2001
354
JP
Have a combo box which is set to style 2.
Added all the items that are needed.
The database then loads appropriate data into combo boxes and text boxes.
The situation is that what happens when data is put into combo boxes and the data does not match the items in the combo box.
What I would like to happen is that when data does not match then it makes the combo box set to empty so that an item can be slected again.
Have tried fooling around with combo properties but can't seem to find anything to match.
 
Have discovered an answer...
using component Microsoft forms 2.0 it will allow you to select an empty row in a comboBox.
Ran the code and on error it will goto a par of code will replaces te data from the database with an empty row in the combobox
 
Also you can do Me.COMBOBOX.ListIndex = -1.
One thing I could not find out is what if you pull data from a database and it does not match that of the combo box.
A quick fix would be to do an on error. Anyone have any ideas on how one might write code to chek the value of the combo box and if the data from the database does not match it places the combobx as empty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top