Probleme d'update visual basic - MS access

cs_xdiethank Messages postés 4 Date d'inscription jeudi 1 janvier 2004 Statut Membre Dernière intervention 15 mai 2006 - 1 mai 2006 à 15:39
cs_xdiethank Messages postés 4 Date d'inscription jeudi 1 janvier 2004 Statut Membre Dernière intervention 15 mai 2006 - 2 mai 2006 à 11:25
Bonjours à tous,

je programme en ce moment un logiciel de gestion de cave à vin.

Mais je bloque là. Voici le code qui me pose probleme.


Set req_ent = db.OpenRecordset("SELECT * FROM TAB_DEVIS Where Categorie
and Appellation and Cru and Titre and Millesime and Contenant and
Fournisseur and Prix LIKE '" &
BCategorie.List(BCategorie.ListIndex) & "' and '" &
BAppellation.List(BAppellation.ListIndex) & "' and '" &
BCru.List(BCru.ListIndex) & "' and '" &
BTitre.List(BTitre.ListIndex) & "' and '" &
BFournisseur.List(BFournisseur.ListIndex) & "' and '" &
Bcontenant.List(Bcontenant.ListIndex) & "' and '" &
BMillesime.List(BMillesime.ListIndex) & "' and '" & leprix.Text
& "'")

If req_ent.BOF Then

db.Execute ("UPDATE TAB_DEVIS  Set Solde = Solde + ('" &
laquantite & "') WHERE Categorie and Appellation and Cru and Titre
and Millesime and Contenant and Fournisseur and Prix LIKE '" &
BCategorie.List(BCategorie.ListIndex) & "' and '" &
BAppellation.List(BAppellation.ListIndex) & "' and '" &
BCru.List(BCru.ListIndex) & "' and '" &
BTitre.List(BTitre.ListIndex) & "' and '" &
BFournisseur.List(BFournisseur.ListIndex) & "' and '" &
Bcontenant.List(Bcontenant.ListIndex) & "' and '" &
BMillesime.List(BMillesime.ListIndex) & "' and '" & leprix.Text
& "'")

Else

db.Execute ("INSERT into
TAB_DEVIS(Categorie,Appellation,Cru,Titre,Fournisseur,Contenant,Millesime,Prix,Solde,Rangement,Commentaires)
values ('" & BCategorie.List(BCategorie.ListIndex) & "', '"
& BAppellation.List(BAppellation.ListIndex) & "', '" &
BCru.List(BCru.ListIndex) & "', '" &
BTitre.List(BTitre.ListIndex) & "', '" &
BFournisseur.List(BFournisseur.ListIndex) & "', '" &
Bcontenant.List(Bcontenant.ListIndex) & "', '" &
BMillesime.List(BMillesime.ListIndex) & "', '" & leprix.Text
& "', '" & laquantite & "', '" & Lerangement &
"','" & comm.Text & "')")

End If

En fait je souhaiterais que si les données que j'ai saisie existe, seul la quantité change.

Mais soit la quantité en question s'additionne à tous les bouteilles, soit rien ne change.


Voyez vous ou se trouve le probleme?


Merci d'avance.

1 réponse

cs_xdiethank Messages postés 4 Date d'inscription jeudi 1 janvier 2004 Statut Membre Dernière intervention 15 mai 2006
2 mai 2006 à 11:25
Personne n'a d'idée?
0
Rejoignez-nous