1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Private Sub Commande19_Click()
On Error GoTo Err_Commande19_Click
Dim oDb As DAO.Database
Dim strCodeSql As String
Dim stDocName As String
'Instance l'objet database
Set oDb = CurrentDb
'Stocke le code SQL dans une variable
strCodeSql = "SELECT * FROM Identifiant"
'Crée la requête
oDb.CreateQueryDef "filtre_expo", strCodeSql
stDocName = "filtre_expo"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Finally:
oDb.Close
Set oDb = Nothing
Exit_Commande19_Click:
Exit Sub
Err_Commande19_Click:
MsgBox Err.Description
Resume Exit_Commande19_Click
End Sub |
Partager