Differentiate between items in DataCombo Box [VB6]

Shaitan00
10-28-2005, 09:06 AM
This should be easy to explain but I assume the solution won't be so simple...
Given a form [frmMain] which has a DataCombo Box [dcbCustomer] which is currently populated by a single RecordSet [oRecsC] which has the list of CUSTOMERS as shown below


Dim oRecsC As New ADODB.Recordset
Set oRecsC = SearchC
Set DcbCustomer.RowSource = oRecsC
DcbCustomer.ListField = oRecsC(0).Name

Thing is there is another RecordSet [oRecsG] that has a list of GROUPS that I also want to add to this DataCombo Box - thus this is my first question, how can I add more then one RecordSet to the DataCombo Box?

Now comes the REAL hard/fun part - I need to find a way to differentiate between the two lists [a CUSTOMER or a GROUP] both visually [maybe make the GROUP entires BOLD or COLORED or ANYTHING...] and via CODE [if a CUSTOMER is selected do this, if a GROUP is selected do that].
Is this possible? Is there a better way to do it? I have been trying to get this to work for a while now and have been completly unable.

So, in the dcbCustomer if the user selects (Private Sub DcbC_Change() event) a CUSTOMER (which originated from the oRecsC list) then do X, if the user selects a GROUP (which originated from the oRecsG list) then do Y.
At the same time if the GROUPS were BOLDED in the list or something so the user can see "this is a Customer and this is a Group" it would be amazing .. I need some way to visually make the difference also.
Any help/hints would be much appreciated, thanks

obot74639
10-28-2005, 11:51 PM
seeing as I cheat all the time and will pay for it (to make things work), maybe you create your own custom recordset in the background, which is a combination of the two, then set a rule where repeated items are always in an order from GROUP, then From the OTHER. Or maybe groups are all BOLD and customers lower case, then the procedure can check and know from the case. I'm saying to manipulate the peices fromt the recordsets before you put them in a combobox, Maybe you end up poulating a standard combo box, from the background recordset, and add a text notation or code to differentiate the two by modifying the strings later. Your background manipulation could be anything to provide you with the recordsets data to manipulate and then present for users, even a text array that you then prepare as needed, then you can add any mods or notation to the text to describe the peices, without changing the original data, then pop that into the user's interface, instead of a direct one step connection (though it maybe possible directly, but I don't know that stuff very well).

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum