Click here to Skip to main content
13,398,090 members (31,406 online)
Rate this:
Please Sign up or sign in to vote.
See more:
<br />
Combo8.Clear<br />
RES.Open "ATTEND", CON, adOpenDynamic, adLockOptimistic, adCmdTable<br />
    If RES.RecordCount > 0 Then<br />
        RES.MoveFirst<br />
            For i = 0 To RES.RecordCount - 1<br />
                Combo8.AddItem RES.Fields("ANM").Value<br />
                Combo8.ItemData(Combo8.NewIndex) = RES.Fields("AID").Value<br />
        RES.MoveNext<br />
        Next<br />
    End If<br />
RES.Close<br />
End Sub<br />

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 1:26am
Updated 24-Dec-12 1:31am
OriginalGriff 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 24-Dec-12 6:38am
Actually I didn't know about this matter. I'll take care of this thing next time.
OriginalGriff 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
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.180216.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2018
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