Commande valider access
sya21
Messages postés
426
Date d'inscription
Statut
Membre
Dernière intervention
-
sya21 Messages postés 426 Date d'inscription Statut Membre Dernière intervention -
sya21 Messages postés 426 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
jai du code vb qui me permet d'inserer ou de supprimer des enregistrements dans une table lorque je clique sur le bouton valider , cependant mon code ne marche pas et je ne trouve pas l'erreur mercu de m'aider
Private Sub Cmd_valid_Click()
On Error GoTo Err_cmd_valid_Click
If chx <> "a" Then
lst_id.Visible = False
lst_nom = ""
Else
lst_id.Visible = True
lst_nom.Visible = False
End If
If chx <> "s" Then
If chx = "a" Then
End If
End If
DoCmd.RunCommand acCmdRecordsGoToNew
lst_id.Requery
lst_id = ""
Now.RowSource = "SELECT avril09.* from avril09; "
Me.Refresh
If chx = "m" Or "a" Then
dmcmd.RunSQL "insert into avril09(division,section,entité_pilotage,identifiant,UP,Nom,Prenom,Agent_Sexe,Grade,Clasniv_grade,n°_fonction,libelle_fonction,clasniv_fct,Agent_Statut,Date_naissance,quotite) values('" & Me.division & "," & Me.section & " , " & Me.[entité pilotage] & " , " & Me.identifiant & " , " & Me.UP & " , " & Me.Prenom & " , " & Me.[Agent Sexe] & " , " & Me.Grade & " , " & Me.clasniv_grade & " , " & Me.[n° fonction] & " , " & Me.Libelle_fonction & " , " & Me.clasniv_fct & " , " & Me.[Agent Statut] & " , " & Me.[Date naissance] & " , " & Me.quotite & "' )"
End If
If chx = "s" Then
dmcmd.RunSQL "delete avril09.* from avril09 where identifiant = " & CLng(lst_id.Value)
DoCmd.RunSQL req
DoCmd.Close acForm, "frm_personnel"
End Sub
merci!!!
jai du code vb qui me permet d'inserer ou de supprimer des enregistrements dans une table lorque je clique sur le bouton valider , cependant mon code ne marche pas et je ne trouve pas l'erreur mercu de m'aider
Private Sub Cmd_valid_Click()
On Error GoTo Err_cmd_valid_Click
If chx <> "a" Then
lst_id.Visible = False
lst_nom = ""
Else
lst_id.Visible = True
lst_nom.Visible = False
End If
If chx <> "s" Then
If chx = "a" Then
End If
End If
DoCmd.RunCommand acCmdRecordsGoToNew
lst_id.Requery
lst_id = ""
Now.RowSource = "SELECT avril09.* from avril09; "
Me.Refresh
If chx = "m" Or "a" Then
dmcmd.RunSQL "insert into avril09(division,section,entité_pilotage,identifiant,UP,Nom,Prenom,Agent_Sexe,Grade,Clasniv_grade,n°_fonction,libelle_fonction,clasniv_fct,Agent_Statut,Date_naissance,quotite) values('" & Me.division & "," & Me.section & " , " & Me.[entité pilotage] & " , " & Me.identifiant & " , " & Me.UP & " , " & Me.Prenom & " , " & Me.[Agent Sexe] & " , " & Me.Grade & " , " & Me.clasniv_grade & " , " & Me.[n° fonction] & " , " & Me.Libelle_fonction & " , " & Me.clasniv_fct & " , " & Me.[Agent Statut] & " , " & Me.[Date naissance] & " , " & Me.quotite & "' )"
End If
If chx = "s" Then
dmcmd.RunSQL "delete avril09.* from avril09 where identifiant = " & CLng(lst_id.Value)
DoCmd.RunSQL req
DoCmd.Close acForm, "frm_personnel"
End Sub
merci!!!
A voir également:
- Commande valider access
- Invite de commande - Guide
- Commande terminal mac - Guide
- Commande dism - Guide
- Acer quick access - Forum Logiciels
- Commande scannow - Guide
83 réponses
J'ai reussis a enregistrer dans ma table
maintenant ce que j'aimerais c'est pouvoir supprimer des personnes lorsque je clique sur mon bouton supprimer
maintenant ce que j'aimerais c'est pouvoir supprimer des personnes lorsque je clique sur mon bouton supprimer
Je n'ai jamais fait mais sur internet je suis certain que ça se trouve facilement, tout comme le INSERT TO là je ne peux plus t'aider et de plus tu as réglé le problème tout seul
bravo et félicitaitons^^ :)
bravo et félicitaitons^^ :)
effectivement le probleme est quasiment réglé car je peux ajouter et modifier des agents , il y a encore quelques champs qui ne s'enregistrent pas
en tout cas merci de ton aide
pour la suppression j'ai bien fait une requete delete from le probleme cest quelle ne marche pas pourtant elle ma l'air bonne
If chx = "s" Then
DoCmd.RunSQL "DELETE avril09.* FROM avril09 WHERE identifiant = " & CLng(lst_id.Value)
DoCmd.RunSQL req
End If
en tout cas merci de ton aide
pour la suppression j'ai bien fait une requete delete from le probleme cest quelle ne marche pas pourtant elle ma l'air bonne
If chx = "s" Then
DoCmd.RunSQL "DELETE avril09.* FROM avril09 WHERE identifiant = " & CLng(lst_id.Value)
DoCmd.RunSQL req
End If