I need a help
Résolu/Fermé
sooprano
Messages postés
33
Date d'inscription
dimanche 9 décembre 2007
Statut
Membre
Dernière intervention
22 avril 2008
-
9 mars 2008 à 16:56
sooprano Messages postés 33 Date d'inscription dimanche 9 décembre 2007 Statut Membre Dernière intervention 22 avril 2008 - 9 mars 2008 à 19:03
sooprano Messages postés 33 Date d'inscription dimanche 9 décembre 2007 Statut Membre Dernière intervention 22 avril 2008 - 9 mars 2008 à 19:03
A voir également:
- I need a help
- I showkeyplus - Télécharger - Utilitaires
- I deux point - Forum Windows
- Comment mettre les deux point sur le i - Forum Windows
- Comment mettre deux points sur un i ✓ - Forum Windows
- I-nfo.fr - actualités tech - Télécharger - Médias et Actualité
4 réponses
Polux31
Messages postés
6917
Date d'inscription
mardi 25 septembre 2007
Statut
Membre
Dernière intervention
1 novembre 2016
1 204
9 mars 2008 à 16:59
9 mars 2008 à 16:59
bonjour,
Comment remplis-tu ta listbox ? avec une requête ? ou en dur dans le code ?
;o)
polux
Comment remplis-tu ta listbox ? avec une requête ? ou en dur dans le code ?
;o)
polux
sooprano
Messages postés
33
Date d'inscription
dimanche 9 décembre 2007
Statut
Membre
Dernière intervention
22 avril 2008
9 mars 2008 à 18:04
9 mars 2008 à 18:04
je remplis le listbox j le programme dans form load
Private Sub form_load()
with E_produit
if not .eof then .movefirst
while not .eof
list1.additem !Num_prod
if not .eof then .movenext
wend
end with
end sub
Private sub list1_click()
text1=list1
text1_lostfocus
end sub
Private Sub Text1_LostFocus()
If Text1 <> "" Then
With E_produit
.Index = "Produit_ndx"
.Seek "=", Text1
If Not .NoMatch Then
Text2 = !Lib_prod
Text3 = !Pu_prod
Text4 = !Qs_prod
Toolbar1.Buttons(1).Enabled = 0 'bouton Enregistrer
Toolbar1.Buttons(2).Enabled = 1 'bouton Modifier
Toolbar1.Buttons(3).Enabled = 1 'bouton Supprimer
Else
Text2.text = "": Text3.text = "": Text4.text = ""
End If
End With
End If
End Sub
Private Sub form_load()
with E_produit
if not .eof then .movefirst
while not .eof
list1.additem !Num_prod
if not .eof then .movenext
wend
end with
end sub
Private sub list1_click()
text1=list1
text1_lostfocus
end sub
Private Sub Text1_LostFocus()
If Text1 <> "" Then
With E_produit
.Index = "Produit_ndx"
.Seek "=", Text1
If Not .NoMatch Then
Text2 = !Lib_prod
Text3 = !Pu_prod
Text4 = !Qs_prod
Toolbar1.Buttons(1).Enabled = 0 'bouton Enregistrer
Toolbar1.Buttons(2).Enabled = 1 'bouton Modifier
Toolbar1.Buttons(3).Enabled = 1 'bouton Supprimer
Else
Text2.text = "": Text3.text = "": Text4.text = ""
End If
End With
End If
End Sub
Polux31
Messages postés
6917
Date d'inscription
mardi 25 septembre 2007
Statut
Membre
Dernière intervention
1 novembre 2016
1 204
9 mars 2008 à 18:44
9 mars 2008 à 18:44
ok
fais une procédure pour remplir la listbox:
Ensuite tu appelles la procédure dans le load de la form :
et tu fais appel à cette procédure (InitListBox) pour la mise à jour dans ton select case :
;o)
polux
fais une procédure pour remplir la listbox:
Private Sub InitListBox() with E_produit list1.clear if not .eof then .movefirst while not .eof list1.additem !Num_prod if not .eof then .movenext wend end with end sub
Ensuite tu appelles la procédure dans le load de la form :
Private Sub form_load() InitListBox end sub
et tu fais appel à cette procédure (InitListBox) pour la mise à jour dans ton select case :
select case buton.index case is = 1 'Bouton Enregistrer va = MsgBox("Voulez Vous Vraiment" & Chr(13) & "Enregistrer Les Données", vbYesNo + VBInformation, "Confirmation") If va = 6 Then SQL = " insert into Produit " & _ " values ('" & Text1 & "' , '" & Text2 & "' , " & Text3 & " , " & Text4 & ")" Base.Execute SQL InitListBox end if ....
;o)
polux
sooprano
Messages postés
33
Date d'inscription
dimanche 9 décembre 2007
Statut
Membre
Dernière intervention
22 avril 2008
9 mars 2008 à 19:03
9 mars 2008 à 19:03
Merci sa marche bien Pr mise a jour pr la Supression et validation a propo d mise a jour lors d la validation on peu faire
Private sub toolbar_button()
select case button.index
Case Is = 1 'Bouton Enregistrer
va = MsgBox("Voulez Vous Vraiment" & Chr(13) & "Enregistrer Les Données", vbYesNo + vbInformation, "Confirmation")
If va = 6 Then
SQL = " insert into Produit " & _
" values ('" & Text1 & "' , '" & Text2 & "' , " & Text3 & " , " & Text4 & ")"
Base.Execute SQL
list1.additem text1 'mise a jour l ors d la validation
Mais on dois programmer textbox lost focus et list1 click
private sub list1_click()
text1=list1
text1_lostfocus
end sub
voila
Merci bcp
Private sub toolbar_button()
select case button.index
Case Is = 1 'Bouton Enregistrer
va = MsgBox("Voulez Vous Vraiment" & Chr(13) & "Enregistrer Les Données", vbYesNo + vbInformation, "Confirmation")
If va = 6 Then
SQL = " insert into Produit " & _
" values ('" & Text1 & "' , '" & Text2 & "' , " & Text3 & " , " & Text4 & ")"
Base.Execute SQL
list1.additem text1 'mise a jour l ors d la validation
Mais on dois programmer textbox lost focus et list1 click
private sub list1_click()
text1=list1
text1_lostfocus
end sub
voila
Merci bcp