j'ai relu ton dernier post
ne met pas dans la procedure Private Sub cbo_proprietaireparc_Click(index As Integer)
met un CommandButton, double click dessus, VB6 va t'ouvrir la procedure
Private Sub Command1_Click()
.........
End Sub
met le code suivant :
Je vais manger mais je reviens de temps en temps pour voir la suite
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 'ouvre la base de données BDclients.Provider = "microsoft.jet.oledb.4.0" BDclients.ConnectionString = App.Path & "\save\save_clients.mdb" On Error Resume Next BDclients.Open If Err.Number <> 0 Then MsgBox CStr(Err.Number) & " " & Err.Description Exit Sub End If 'On Error Resume Next est toujours dispo inutil de le respecifier tbclients.Open "Select*from table1", BDclients, adOpenDynamic, adLockOptimistic If Err.Number <> 0 Then MsgBox CStr(Err.Number) & " " & Err.Description Exit Sub else If Not tbclients.EOF Then Do While Not tbclients.EOF cbo_proprietaireparc.AddItem tbclients!Nom & " " & tbclients!prenom tbclients.MoveNext: DoEvents Loop End If If cbo_proprietaireparc.ListCount = 0 Then cbo_proprietaireparc.AddItem "Aucun enregistrement" cbo_proprietaireparc.ListIndex = 0 End If 'ferme la base de données tbclients.Close BDclients.Close Set tbclients = Nothing Set BDclients = Nothing
ProgElecT
Partager