ArchonSoft
Programmer
Here is my code:
Private Sub btnFermer_Click()
On Error GoTo Err_btnFermer_Click
'variables
Dim rstWrite As DAO.Recordset
Dim msg As Integer
Dim dbsInOut As Database
'show confirmation message
msg = MsgBox("Votre statut a été mis à jour. Clickez sur <OK> pour revenir au menu principale.", vbOKOnly + vbInformation, "Opération réussie!"
'Reference to the current database
>>> Set dbsInOut = CurrentDb
'reference to table historique
Set rstWrite = dbsInOut.OpenRecordset("historique", dbOpenDynaset)
'write change into table historique
With rstWrite
.AddNew
!Nom = Nom
!Statut = Statut
!Lieux = Lieux
!HeureRetour = HeureRetour
!SuiviAppels = SuiviAppels
!Commentaires = Commentaires
!Date = Now
.Update
End With
DoCmd.Close acForm, "frmInOut"
DoCmd.OpenForm "frmStart"
Exit_btnFermer_Click:
Exit Sub
Err_btnFermer_Click:
MsgBox Err.Description
Resume Exit_btnFermer_Click
End Sub
The problem seems to happen to the line mark with >>>
where I've got the error: active x component can't create object
But this database works well on all computers except one?
Help please
Private Sub btnFermer_Click()
On Error GoTo Err_btnFermer_Click
'variables
Dim rstWrite As DAO.Recordset
Dim msg As Integer
Dim dbsInOut As Database
'show confirmation message
msg = MsgBox("Votre statut a été mis à jour. Clickez sur <OK> pour revenir au menu principale.", vbOKOnly + vbInformation, "Opération réussie!"
'Reference to the current database
>>> Set dbsInOut = CurrentDb
'reference to table historique
Set rstWrite = dbsInOut.OpenRecordset("historique", dbOpenDynaset)
'write change into table historique
With rstWrite
.AddNew
!Nom = Nom
!Statut = Statut
!Lieux = Lieux
!HeureRetour = HeureRetour
!SuiviAppels = SuiviAppels
!Commentaires = Commentaires
!Date = Now
.Update
End With
DoCmd.Close acForm, "frmInOut"
DoCmd.OpenForm "frmStart"
Exit_btnFermer_Click:
Exit Sub
Err_btnFermer_Click:
MsgBox Err.Description
Resume Exit_btnFermer_Click
End Sub
The problem seems to happen to the line mark with >>>
where I've got the error: active x component can't create object
But this database works well on all computers except one?
Help please