Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6 Oracle

Combo8.Clear
RES.Open "ATTEND", CON, adOpenDynamic, adLockOptimistic, adCmdTable
If RES.RecordCount > 0 Then
RES.MoveFirst
For i = 0 To RES.RecordCount - 1
Combo8.AddItem RES.Fields("ANM").Value
Combo8.ItemData(Combo8.NewIndex) = RES.Fields("AID").Value
RES.MoveNext
Next
End If
RES.Close
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
surkhi623
Edited 24-Dec-12 0:31am
v2
Comments
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.
Thanx
OriginalGriff at 24-Dec-12 6:44am
   
It's called Netiquette: http://en.wikipedia.org/wiki/Etiquette_(technology)
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
good
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.Clear
                Combo1.AddItem ""
            
                With Rs
                    Do While Not .EOF
                        Combo1.AddItem Rs(0)
                        .MoveNext
                    Loop
                    .Close
                End With
                    
                Combo1.Visible = True
                Combo1.SetFocus
            End If
  Permalink  

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



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