ADO VB6 Update ACCESS

cs_JeffC1977 Messages postés 928 Date d'inscription vendredi 10 novembre 2000 Statut Membre Dernière intervention 23 septembre 2023 - 12 août 2005 à 14:46
Doro81079 Messages postés 380 Date d'inscription vendredi 22 avril 2005 Statut Membre Dernière intervention 24 février 2015 - 12 août 2005 à 19:02
Salut....

J'ai un problème avec mon update....

Mon programme est utilisé pour faire le suivi des dossier...

Si par exmeple le dossier se retourve au dessinateur, on coche optButton Dessin, si par contre le dossier est transférer au calcultauer on coche optbutton Calcul etc...

Quand j'ouvre le programme, le premier dossier de la Base de Données est visible (c'est le dossier 37904) et j'ai l'enssemble de l'information qui est affiché... Jusqu'ici ca fonctionne tres bien. Si je modifie ce dossier (je change d'OPTButton) et que j'appuis sur le bouton commandButton cmdModifier, ca marche... Les modification sont enregistrées. Toutefois si je fais une recherche (par exemple je recherche le dossier 37905(en utilissant un cmdrecherche et un txtRechercheNormal)). Je verrai apparaitre l'information. Je verrai que le Dossier se trouve au Calcul. Si je modifie le optButton et que je le met au Dessin (Op4(optButton)) et que j'apuis sur le cmdModifier (le bouton pour faire le update), ca marche. Les info sont "sauvé et tout ce qui doit être modifié à été changé.
Cependant si je recherche un dossier (par exmeple le dossier 37904) et que je reviens au dossier 37905 (en faisant une autre recherche) et bine je me rend compte que le uptdate n'a pas fonctionner, Le optButton est encore au Calcul.


Pourquoi mon update fonctionne au premier dossier (dossier lors de l'ouverture du programme) et que ca ne fonctionne pas pour les autres dossier ?????

Voici l'intégrale de mon code et merci d'avance

Private Sub cmdmodifier_Click()
On Error Resume Next

If Op1.Value = True Then
txtRecherche.Text = "X"
Else
txtRecherche.Text = ""
End If
If Op2.Value = True Then
txtAttenteTerrain.Text = "X"
Else
txtAttenteTerrain.Text = ""
End If
If Op3.Value = True Then
txtCalcul.Text = "X"
Else
txtCalcul.Text = ""
End If
If Op4.Value = True Then
txtDessin.Text = "X"
Else
txtDessin.Text = ""
End If
If Op5.Value = True Then
txtRapport.Text = "X"
Else
txtRapport.Text = ""
End If
If Op6.Value = True Then
txtYvon.Text = "X"
Else
txtYvon.Text = ""
End If
If Op7.Value = True Then
txtAttenteTirroir.Text = "X"
Else
txtAttenteTirroir.Text = ""
End If
If Op8.Value = True Then
txtBureauPascal.Text = "X"
Else
txtBureauPascal.Text = ""
End If


BD.Save
BD!Dossier = txtDossier.Text
If txtLivraison.Text <> "" Then
BD!LIVRAISON = txtLivraison.Text
Else
GoTo travail
End If
travail:
BD!travail = txtTravail.Text
BD!RÉFÉRENCE = txtReference.Text
BD!REMARQUE = txtRemarque.Text
BD!RECHERCHE = txtRecherche.Text
BD!ATTENTE_TERRAIN = txtAttenteTerrain.Text
BD!CALCUL = txtCalcul.Text
BD!DESSIN = txtDessin.Text
BD!RAPPORT = txtRapport.Text
BD!YVON = txtYvon.Text
BD!ATTENTE_TIRROIR = txtAttenteTirroir.Text
BD!PASCAL = txtBureauPascal.Text

BD!RECHERCHEACTIF = txtRechercheActif.Text
BD!ATTENTE_TERRAINACTIF = txtAttenteTerrainActif.Text
BD!CALCULACTIF = txtCalculActif.Text
BD!DESSINACTIF = txtDessinActif.Text
BD!RAPPORTACTIF = txtRapportActif.Text
BD!YVONACTIF = txtYvonActif.Text
BD!ATTENTE_TIRROIRACTIF = txtAttenteTirroirActif.Text
BD.Update

txtRechercheNormale.SetFocus

Timer1.Enabled = True
Timer1.Interval = 2000
lblTimer.Caption = "Données modifiées!"

End Sub

Private Sub Timer1_Timer()
lblTimer.Caption = ""
End Sub

Private Sub Form_Activate()
Set txtDossier.DataSource = BD
txtDossier.DataField = "DOSSIER"

Set txtLivraison.DataSource = BD
txtLivraison.DataField = "LIVRAISON"

Set txtTravail.DataSource = BD
txtTravail.DataField = "TRAVAIL"

Set txtRecherche.DataSource = BD
txtRecherche.DataField = "RECHERCHE"
Set txtRechercheActif.DataSource = BD
txtRechercheActif.DataField = "RECHERCHEACTIF"

Set txtAttenteTerrain.DataSource = BD
txtAttenteTerrain.DataField = "ATTENTE_TERRAIN"
Set txtAttenteTerrainActif.DataSource = BD
txtAttenteTerrainActif.DataField = "ATTENTE_TERRAINACTIF"

Set txtCalcul.DataSource = BD
txtCalcul.DataField = "CALCUL"
Set txtCalculActif.DataSource = BD
txtCalculActif.DataField = "CALCULACTIF"

Set txtDessin.DataSource = BD
txtDessin.DataField = "DESSIN"
Set txtDessinActif.DataSource = BD
txtDessinActif.DataField = "DESSINACTIF"

Set txtRapport.DataSource = BD
txtRapport.DataField = "RAPPORT"
Set txtRapportActif.DataSource = BD
txtRapportActif.DataField = "RAPPORTACTIF"

Set txtYvon.DataSource = BD
txtYvon.DataField = "YVON"
Set txtYvonActif.DataSource = BD
txtYvonActif.DataField = "YVONACTIF"

Set txtAttenteTirroir.DataSource = BD
txtAttenteTirroir.DataField = "ATTENTE_TIRROIR"
Set txtAttenteTirroirActif.DataSource = BD
txtAttenteTirroirActif.DataField = "ATTENTE_TIRROIRACTIF"

Set txtBureauPascal.DataSource = BD
txtBureauPascal.DataField = "PASCAL"

Set txtReference.DataSource = BD
txtReference.DataField = "RÉFÉRENCE"

Set txtRemarque.DataSource = BD
txtRemarque.DataField = "REMARQUE"

End Sub

Private Sub Form_Load()
On Error Resume Next
connection.Provider = "Microsoft.jet.OLEDB.4.0"
'Chemin de la base de donnée (APP.PATH permet de ce mettre dans le chemin
'courant la ou ce trouve le projet)- Paramettrage de la chaine de connection
connection.ConnectionString = App.Path & "\dossier_actif.mdb"
'Ouverture de la connection
connection.Open

'Set BD = New ADODB.Recordset

'Ouverture de la requête sql dans le recordset
BD.Open "Select * from dossiers_actif", connection, adOpenDynamic, adLockOptimistic

Me.Show

'Code pour centrer la feuille

'Me.Top = searchmodDossier.Height / 2 - Me.Height
'Me.Left = searchmodDossier.Width / 2 - Me.Width / 2


' Pour faire apparaître de l'Info dans le ListView
Init_ListView

optDossier.Value = True

Form_Activate


txtRechercheNormale.SetFocus


End Sub

Private Sub cmdRecherche_Click()
Dim msg1, msg2 As String

If txtRechercheNormale.Text = "" Or IsNull(txtRechercheNormale) Then
msg1 = MsgBox("Vous devez indiquer un Nº de dossier !", vbInformation + vbOKOnly)
txtRechercheNormale.SetFocus

ElseIf optDossier.Value = True Then

Set BD2 = New ADODB.Recordset
BD2.Open "SELECT * FROM [dossiers_actif] WHERE [DOSSIER] like '%" & txtRechercheNormale.Text & "%'", connection, adOpenKeyset, adLockBatchOptimistic

If Not BD2.EOF Then
txtDossier.Text = BD2!Dossier & ""
txtTravail.Text = BD2!travail & ""
txtLivraison.Text = BD2!LIVRAISON & ""
txtAttenteTerrain.Text = BD2!ATTENTE_TERRAIN & ""
txtAttenteTirroir.Text = BD2!ATTENTE_TIRROIR & ""
txtRecherche.Text = BD2!RECHERCHE & ""
txtDessin.Text = BD2!DESSIN & ""
txtRapport.Text = BD2!RAPPORT & ""
txtYvon.Text = BD2!YVON & ""
txtReference.Text = BD2!RÉFÉRENCE & ""
txtRemarque.Text = BD2!REMARQUE & ""
txtBureauPascal.Text = BD2!PASCAL & ""

txtAttenteTerrainActif.Text = BD2!ATTENTE_TERRAINACTIF & ""
txtAttenteTirroirActif.Text = BD2!ATTENTE_TIRROIRACTIF & ""
txtRechercheActif.Text = BD2!RECHERCHEACTIF & ""
txtCalculActif.Text = BD2!CALCULACTIF & ""
txtDessinActif.Text = BD2!DESSINACTIF & ""
txtRapportActif.Text = BD2!RAPPORTACTIF & ""
txtYvonActif.Text = BD2!YVONACTIF & ""


BD2005.Open "SELECT * FROM [TRAVAUX EN COURS 2005] WHERE [DOSSIER] like '%" & txtRechercheNormale.Text & "%'", connection, adOpenKeyset, adLockBatchOptimistic

With ListView1.ListItems.Add(, , IsN(BD2005!Dossier)) 'Colonne 1
.SubItems(1) = IsN(BD2005![DATE D'OUVERTURE]) ' Colonne '2
.SubItems(2) = IsN(BD2005![NATURE DU TRAVAIL]) ' Colonne 3
.SubItems(3) = IsN(BD2005!LOTS) ' Colonne 4
.SubItems(4) = IsN(BD2005!CADASTRE) ' Colonne 5
.SubItems(5) = IsN(BD2005!CLIENTS) ' Colonne 6
.SubItems(6) = IsN(BD2005!TELEPHONE) ' Colonne 7
.SubItems(7) = IsN(BD2005!ADRESSE) ' Colonne 8
.SubItems(8) = IsN(BD2005!MUNICIPALITE)
.SubItems(9) = IsN(BD2005![DATE DE LIVRAISON]) ' Colonne 9
.SubItems(10) = IsN(BD2005!TERMINE) ' Colonne 10
.SubItems(11) = IsN(BD2005!REMARQUES) ' Colonne 11
End With

BD2005.Close
Set ListView1.SelectedItem = Nothing

Else
msg2 = MsgBox("Dossier inéxistant, veuillez saisir un N° de dossier existant !", vbInformation + vbOKOnly)
txtRechercheNormale.SetFocus
End If

ElseIf optReference.Value = True Then

Set BD2 = New ADODB.Recordset
BD2.Open "SELECT * FROM [dossiers_actif] WHERE [RÉFÉRENCE] like '%" & txtRechercheNormale.Text & "%'", connection, adOpenKeyset, adLockBatchOptimistic

If Not BD2.EOF Then
txtDossier.Text = BD2!Dossier & ""
txtTravail.Text = BD2!travail & ""
txtLivraison.Text = BD2!LIVRAISON & ""
txtAttenteTerrain.Text = BD2!ATTENTE_TERRAIN & ""
txtAttenteTirroir.Text = BD2!ATTENTE_TIRROIR & ""
txtRecherche.Text = BD2!RECHERCHE & ""
txtDessin.Text = BD2!DESSIN & ""
txtRapport.Text = BD2!RAPPORT & ""
txtYvon.Text = BD2!YVON & ""
txtReference.Text = BD2!RÉFÉRENCE & ""
txtRemarque.Text = BD2!REMARQUE & ""
txtBureauPascal.Text = BD2!PASCAL & ""

txtAttenteTerrainActif.Text = BD2!ATTENTE_TERRAINACTIF & ""
txtAttenteTirroirActif.Text = BD2!ATTENTE_TIRROIRACTIF & ""
txtRechercheActif.Text = BD2!RECHERCHEACTIF & ""
txtCalculActif.Text = BD2!CALCULACTIF & ""
txtDessinActif.Text = BD2!DESSINACTIF & ""
txtRapportActif.Text = BD2!RAPPORTACTIF & ""
txtYvonActif.Text = BD2!YVONACTIF & ""

Else
msg2 = MsgBox("Dossier inéxistant, veuillez saisir un N° de dossier existant !", vbInformation + vbOKOnly)
txtRechercheNormale.SetFocus
End If
End If





txtRechercheNormale.SetFocus
txtRechercheNormale.Text = ""

End Sub

Function IsN(Valeur As Variant) As String

If IsNull(Valeur) Then
IsN = ""
Else
IsN = Valeur
End If

End Function

Private Sub cmd_Ajout_Click()
ajoutDossier.Show
Unload Me
End Sub



Private Sub cmd_Supprimer_Click()
Dim msg1 As String

Supression = MsgBox("Êtes-vous certain de vouloir suprimer ce Dossier?", vbYesNo, "Attention")

If Supression = vbYes Then

'Permet de supprimer l'enregistrement en cour
BD.Delete
BD.MovePrevious
msg1 = MsgBox("Données supprimées !", vbInformation + vbOKOnly)
'S'il n'y a plus d'enregistrement aller au premier
If BD.BOF Then
BD.MoveFirst
End If

End If

End Sub


Private Sub cmd_Precedent_Click()
Call Form_Activate
BD.MovePrevious

'S'il n'y a plus d'enregistrement aller au premier
If BD.BOF Then
BD.MoveFirst
End If

End Sub

Private Sub cmd_Suivant_Click()
Call Form_Activate
'Permet d'aller a l'enregistrement suivant dans la table
BD.MoveNext

'S'il n'y a plus d'enregistrement aller au dernier
If BD.EOF Then
BD.MoveLast
End If

End Sub

Private Sub cmd_Quitter_Click()
'fermeture des tables et de la base
On Error Resume Next
BD.Close
BD2.Close
BD2005.Close
connection.Close
Set BD = Nothing
Set BD2 = Nothing
Set BD2005 = Nothing
'fin du programme
End
End Sub

Private Sub Init_ListView()

'Initialisation de la listview
ListView1.View = lvwReport ' Crer une ligne pour affichier les différents titre des colonnes.
ListView1.ColumnHeaders.Clear
ListView1.ListItems.Clear
ListView1.BackColor = &HE0E0E0

ListView1.ColumnHeaders.Add , , "Dossier", ListView1.Width / 7
ListView1.ColumnHeaders.Add , , "Ouverture", ListView1.Width / 6, lvwColumnCenter
ListView1.ColumnHeaders.Add , , "Nature du travail", ListView1.Width / 3, lvwColumnCenter
ListView1.ColumnHeaders.Add , , "Lots", ListView1.Width / 4, lvwColumnCenter
ListView1.ColumnHeaders.Add , , "Cadastre", ListView1.Width / 4, lvwColumnCenter
ListView1.ColumnHeaders.Add , , "Clients", ListView1.Width / 4, lvwColumnCenter
ListView1.ColumnHeaders.Add , , "Téléphonne", ListView1.Width / 7, lvwColumnCenter
ListView1.ColumnHeaders.Add , , "Adresse", ListView1.Width / 5, lvwColumnCenter
ListView1.ColumnHeaders.Add , , "Municipalité", ListView1.Width / 5, lvwColumnCenter
ListView1.ColumnHeaders.Add , , "Livraison", ListView1.Width / 7, lvwColumnCenter
ListView1.ColumnHeaders.Add , , "Terminé", ListView1.Width / 10, lvwColumnCenter
ListView1.ColumnHeaders.Add , , "Remarque", ListView1.Width / 3, lvwColumnCenter

End Sub





Private Sub txtLivraison_KeyPress(KeyAscii As Integer)
If KeyAscii = 46 Then
KeyAscii = 47
End If
End Sub

'Lorsqu'il y a un changement au textbox le checkbox se modifie
'***************************************************************************
Private Sub txtRecherche_Change()

If txtRecherche.Text <> "" Then
Op1.Value = True
Else
Op1.Value = False
End If

End Sub

Private Sub txtAttenteTerrain_Change()
If txtAttenteTerrain.Text <> "" Then
Op2.Value = True
Else
Op2.Value = False
End If

End Sub

Private Sub txtCalcul_Change()
If txtCalcul.Text <> "" Then
Op3.Value = True
Else
Op3.Value = False
End If

End Sub

Private Sub txtDessin_Change()
If txtDessin.Text <> "" Then
Op4.Value = True
Else
Op4.Value = False
End If

End Sub

Private Sub txtRapport_Change()
If txtRapport.Text <> "" Then
Op5.Value = True
Else
Op5.Value = False
End If

End Sub

Private Sub txtYvon_Change()
If txtYvon.Text <> "" Then
Op6.Value = True
Else
Op6.Value = False
End If

End Sub

Private Sub txtAttenteTirroir_Change()
If txtAttenteTirroir.Text <> "" Then
Op7.Value = True
Else
Op7.Value = False
End If

End Sub

3 réponses

Paladin2107 Messages postés 154 Date d'inscription samedi 25 octobre 2003 Statut Membre Dernière intervention 5 septembre 2008 1
12 août 2005 à 14:56
en résumant ca donne quoi

Couscous
0
cs_JeffC1977 Messages postés 928 Date d'inscription vendredi 10 novembre 2000 Statut Membre Dernière intervention 23 septembre 2023 4
12 août 2005 à 15:12
Un résumé du code....

Je vais essayé j'ai mit le code où le problème peut survenir....
Étant donné que j'ai aucunne idée d'où peut provenir mon problème...

Si quelqu'un le désire, je peux toujours vous envoyé mon code...

P.S. J'ai supprimer des parties de code et je n'ai pas mit le Form_Load étant donné que ca fonctionne bien

*************************************************************

Voici le Code pour le Bouton CMDMODIFER (UPDATE)


Private Sub cmdmodifier_Click()
On Error Resume Next

If Op1.Value = True Then
txtRecherche.Text = "X"
Else
txtRecherche.Text = ""
End If
If Op2.Value = True Then
txtAttenteTerrain.Text = "X"
Else
txtAttenteTerrain.Text = ""
End If
If Op3.Value = True Then
txtCalcul.Text = "X"
Else
txtCalcul.Text = ""
End If
If Op4.Value = True Then
txtDessin.Text = "X"
Else
txtDessin.Text = ""
End If
If Op5.Value = True Then
txtRapport.Text = "X"
Else
txtRapport.Text = ""
End If
If Op6.Value = True Then
txtYvon.Text = "X"
Else
txtYvon.Text = ""
End If
If Op7.Value = True Then
txtAttenteTirroir.Text = "X"
Else
txtAttenteTirroir.Text = ""
End If
If Op8.Value = True Then
txtBureauPascal.Text = "X"
Else
txtBureauPascal.Text = ""
End If


BD.Save
BD!Dossier = txtDossier.Text
If txtLivraison.Text <> "" Then
BD!LIVRAISON = txtLivraison.Text
Else
GoTo travail
End If
travail:
BD!travail = txtTravail.Text
BD!RÉFÉRENCE = txtReference.Text
BD!REMARQUE = txtRemarque.Text
BD!RECHERCHE = txtRecherche.Text
BD!ATTENTE_TERRAIN = txtAttenteTerrain.Text
BD!CALCUL = txtCalcul.Text
BD!DESSIN = txtDessin.Text
BD!RAPPORT = txtRapport.Text
BD!YVON = txtYvon.Text
BD!ATTENTE_TIRROIR = txtAttenteTirroir.Text
BD!PASCAL = txtBureauPascal.Text

BD!RECHERCHEACTIF = txtRechercheActif.Text
BD!ATTENTE_TERRAINACTIF = txtAttenteTerrainActif.Text
BD!CALCULACTIF = txtCalculActif.Text
BD!DESSINACTIF = txtDessinActif.Text
BD!RAPPORTACTIF = txtRapportActif.Text
BD!YVONACTIF = txtYvonActif.Text
BD!ATTENTE_TIRROIRACTIF = txtAttenteTirroirActif.Text
BD.Update

txtRechercheNormale.SetFocus

Timer1.Enabled = True
Timer1.Interval = 2000
lblTimer.Caption = "Données modifiées!"

End Sub


***************************************************************


Code pour Mon ACTIVATE

Private Sub Form_Activate()
Set txtDossier.DataSource = BD
txtDossier.DataField = "DOSSIER"

Set txtLivraison.DataSource = BD
txtLivraison.DataField = "LIVRAISON"

Set txtTravail.DataSource = BD
txtTravail.DataField = "TRAVAIL"

Set txtRecherche.DataSource = BD
txtRecherche.DataField = "RECHERCHE"
Set txtRechercheActif.DataSource = BD
txtRechercheActif.DataField = "RECHERCHEACTIF"

Set txtAttenteTerrain.DataSource = BD
txtAttenteTerrain.DataField = "ATTENTE_TERRAIN"
Set txtAttenteTerrainActif.DataSource = BD
txtAttenteTerrainActif.DataField = "ATTENTE_TERRAINACTIF"

Set txtCalcul.DataSource = BD
txtCalcul.DataField = "CALCUL"
Set txtCalculActif.DataSource = BD
txtCalculActif.DataField = "CALCULACTIF"

Set txtDessin.DataSource = BD
txtDessin.DataField = "DESSIN"
Set txtDessinActif.DataSource = BD
txtDessinActif.DataField = "DESSINACTIF"

Set txtRapport.DataSource = BD
txtRapport.DataField = "RAPPORT"
Set txtRapportActif.DataSource = BD
txtRapportActif.DataField = "RAPPORTACTIF"

Set txtYvon.DataSource = BD
txtYvon.DataField = "YVON"
Set txtYvonActif.DataSource = BD
txtYvonActif.DataField = "YVONACTIF"

Set txtAttenteTirroir.DataSource = BD
txtAttenteTirroir.DataField = "ATTENTE_TIRROIR"
Set txtAttenteTirroirActif.DataSource = BD
txtAttenteTirroirActif.DataField = "ATTENTE_TIRROIRACTIF"

Set txtBureauPascal.DataSource = BD
txtBureauPascal.DataField = "PASCAL"

Set txtReference.DataSource = BD
txtReference.DataField = "RÉFÉRENCE"

Set txtRemarque.DataSource = BD
txtRemarque.DataField = "REMARQUE"

End Sub

********************************************************************

Code pour mon Bouton RECHERCHE


Private Sub cmdRecherche_Click()
Dim msg1, msg2 As String

If txtRechercheNormale.Text = "" Or IsNull(txtRechercheNormale) Then
msg1 = MsgBox("Vous devez indiquer un Nº de dossier !", vbInformation + vbOKOnly)
txtRechercheNormale.SetFocus

ElseIf optDossier.Value = True Then

Set BD2 = New ADODB.Recordset
BD2.Open "SELECT * FROM [dossiers_actif] WHERE [DOSSIER] like '%" & txtRechercheNormale.Text & "%'", connection, adOpenKeyset, adLockBatchOptimistic

If Not BD2.EOF Then
txtDossier.Text = BD2!Dossier & ""
txtTravail.Text = BD2!travail & ""
txtLivraison.Text = BD2!LIVRAISON & ""
txtAttenteTerrain.Text = BD2!ATTENTE_TERRAIN & ""
txtAttenteTirroir.Text = BD2!ATTENTE_TIRROIR & ""
txtRecherche.Text = BD2!RECHERCHE & ""
txtDessin.Text = BD2!DESSIN & ""
txtRapport.Text = BD2!RAPPORT & ""
txtYvon.Text = BD2!YVON & ""
txtReference.Text = BD2!RÉFÉRENCE & ""
txtRemarque.Text = BD2!REMARQUE & ""
txtBureauPascal.Text = BD2!PASCAL & ""

txtAttenteTerrainActif.Text = BD2!ATTENTE_TERRAINACTIF & ""
txtAttenteTirroirActif.Text = BD2!ATTENTE_TIRROIRACTIF & ""
txtRechercheActif.Text = BD2!RECHERCHEACTIF & ""
txtCalculActif.Text = BD2!CALCULACTIF & ""
txtDessinActif.Text = BD2!DESSINACTIF & ""
txtRapportActif.Text = BD2!RAPPORTACTIF & ""
txtYvonActif.Text = BD2!YVONACTIF & ""


BD2005.Open "SELECT * FROM [TRAVAUX EN COURS 2005] WHERE [DOSSIER] like '%" & txtRechercheNormale.Text & "%'", connection, adOpenKeyset, adLockBatchOptimistic


Else
msg2 = MsgBox("Dossier inéxistant, veuillez saisir un N° de dossier existant !", vbInformation + vbOKOnly)
txtRechercheNormale.SetFocus
End If


End If
End If

txtRechercheNormale.SetFocus
txtRechercheNormale.Text = ""

End Sub

********************************************************

'Code lorsque dans le txtbox se modifie ca modifie le optbutton

Private Sub txtRecherche_Change()

If txtRecherche.Text <> "" Then
Op1.Value = True
Else
Op1.Value = False
End If

End Sub

Private Sub txtAttenteTerrain_Change()
If txtAttenteTerrain.Text <> "" Then
Op2.Value = True
Else
Op2.Value = False
End If

End Sub

Private Sub txtCalcul_Change()
If txtCalcul.Text <> "" Then
Op3.Value = True
Else
Op3.Value = False
End If

End Sub

Private Sub txtDessin_Change()
If txtDessin.Text <> "" Then
Op4.Value = True
Else
Op4.Value = False
End If

End Sub

Private Sub txtRapport_Change()
If txtRapport.Text <> "" Then
Op5.Value = True
Else
Op5.Value = False
End If

End Sub

Private Sub txtYvon_Change()
If txtYvon.Text <> "" Then
Op6.Value = True
Else
Op6.Value = False
End If

End Sub

Private Sub txtAttenteTirroir_Change()
If txtAttenteTirroir.Text <> "" Then
Op7.Value = True
Else
Op7.Value = False
End If

End Sub
0
Doro81079 Messages postés 380 Date d'inscription vendredi 22 avril 2005 Statut Membre Dernière intervention 24 février 2015 56
12 août 2005 à 19:02
bonjour,
j'avais oublier de te dire
pour le bouton modif
enlève bd.save il ne faut rien mettre pour une modif en clair ça doit donner ça

BD!Dossier = txtDossier.Text
If txtLivraison.Text <> "" Then
BD!LIVRAISON = txtLivraison.Text
Else
GoTo travail
End If
travail:
BD!travail = txtTravail.Text
BD!RÉFÉRENCE = txtReference.Text
BD!REMARQUE = txtRemarque.Text
BD!RECHERCHE = txtRecherche.Text
BD!ATTENTE_TERRAIN = txtAttenteTerrain.Text
BD!CALCUL = txtCalcul.Text
BD!DESSIN = txtDessin.Text
BD!RAPPORT = txtRapport.Text
BD!YVON = txtYvon.Text
BD!ATTENTE_TIRROIR = txtAttenteTirroir.Text
BD!PASCAL = txtBureauPascal.Text

BD!RECHERCHEACTIF = txtRechercheActif.Text
BD!ATTENTE_TERRAINACTIF = txtAttenteTerrainActif.Text
BD!CALCULACTIF = txtCalculActif.Text
BD!DESSINACTIF = txtDessinActif.Text
BD!RAPPORTACTIF = txtRapportActif.Text
BD!YVONACTIF = txtYvonActif.Text
BD!ATTENTE_TIRROIRACTIF = txtAttenteTirroirActif.Text
BD.Update

salut
doro
0
Rejoignez-nous