J'ai emprunté ce code et cela semble fonctionner correctement. Cependant, je voudrais qu'il affiche un message si le proc stocké ne renvoie aucun enregistrement? Votre aide est grandement appréciée.Code VBA appelant une boîte de message proc-display stockée si aucun enregistrement n'est retourné
Private Sub CommandButton1_Click()
Dim property_id As Double
property_id = Sheets("Pro Forma Input").Range("AD3").Value
With ActiveWorkbook.Connections("MyDataConnection").OLEDBConnection
.CommandText = "EXEC dbo.my_stored_proc '" & property_id & "'"
ActiveWorkbook.Connections("MyDataConnection").Refresh
End With
Application.DisplayAlerts = True
End Sub
Cette connexion est attachée à quelque chose (une table de requête, un objet de liste, une table pivotante). Vérifiez les données qu'ils ont après l'actualisation. – GSerg