need help with a code in VB6.. please

0 simon nortro · May 23, 2015
Hi,
I have created a forum in vb6 and made connection with a database in access,everything went perfect.
my problem is in my form there is 2 combobox one to select Number and other to get me other numbers (watch the video to understand :))
anyway the first combo is working and the second combo is working too but after selecting different number from the first combo i don't get anything in the second combo.anyway i know i just miss something in the code something very stupid :)
i have uploaded a video so you can see my problem, thanks in advance.


Private Sub Form_Load()
liaison
Do Until rspatient.EOF
   Me.npa.AddItem rspatient.Fields(0)
   rspatient.MoveNext
   Loop
End Sub

Private Sub npa_Click()
rspatient.MoveFirst
Dim cr As String
cr = "npation ='" & npa & "'"
rspatient.Find cr
nom = rspatient.Fields(1)
prenom = rspatient.Fields(3)
rshospita.MoveFirst
nh.Clear
While rshospita.EOF = False
   If UCase(rshospita.Fields(14)) = UCase(npa) Then
         nh.AddItem rshospita.Fields(0)
         End If
         rshospita.MoveNext
         Wend

End Sub

Post a Reply

Replies

Oldest  Newest  Rating
0 simon nortro · May 26, 2015
solved thank you anyway :)
  • 1

Visual Basic

107,305 followers
About

One of the first products to provide a graphical environment and a paint metaphor for developing user interfaces.

Links
Moderators
Bucky Roberts Administrator