Click here to Skip to main content
11,641,224 members (63,160 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: VB6 Oracle

RES.Open "ATTEND", CON, adOpenDynamic, adLockOptimistic, adCmdTable
If RES.RecordCount > 0 Then
For i = 0 To RES.RecordCount - 1
Combo8.AddItem RES.Fields("ANM").Value
Combo8.ItemData(Combo8.NewIndex) = RES.Fields("AID").Value
End If
End Sub

Will this code help me to load anm(attendant name)as well as aid in single combo box?
Actually I want to show anm(attendant name) in combo8 referencing the aid which is pk of attend tab and fk of another table.
at the time of updating/changing values of anm(attendant name)will it consider aid field.
Means it sh'd change or store aid but only show anm in combo8.............
Please help

[edit]SHOUTING removed - OriginalGriff[/edit]
Posted 24-Dec-12 0:26am
Edited 24-Dec-12 0:31am
OriginalGriff at 24-Dec-12 6:31am
DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously.
Member 9687206 at 24-Dec-12 6:38am
Actually I didn't know about this matter. I'll take care of this thing next time.
OriginalGriff at 24-Dec-12 6:44am
It's called Netiquette:
Ignoring it is the same as going into a restaurant and being rude, loud and abusive to the staff. You won't get served better, but you might get something in your food you didn't ask for, or want...

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

May be following code will help.

If Rs.State = 1 Then Rs.Close
Rs.Open "select distinct(Your_Field) from Your_Table order by Your_Field", Con, adOpenKeyset, adLockPessimistic
            If Rs.RecordCount > 0 Then
                Combo1.AddItem ""
                With Rs
                    Do While Not .EOF
                        Combo1.AddItem Rs(0)
                End With
                Combo1.Visible = True
            End If

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Mika Wendelius 420
1 DamithSL 213
2 OriginalGriff 205
3 CPallini 169
4 Afzaal Ahmad Zeeshan 129
0 Mika Wendelius 400
1 OriginalGriff 205
2 DamithSL 203
3 CPallini 185
4 Afzaal Ahmad Zeeshan 129

Advertise | Privacy | Mobile
Web04 | 2.8.150731.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100