Déclaration de texte VBA Access

Fermé
ptitsofi - 21 nov. 2009 à 18:50
Polux31 Messages postés 6917 Date d'inscription mardi 25 septembre 2007 Statut Membre Dernière intervention 1 novembre 2016 - 21 nov. 2009 à 19:00
Bonjour,

j'essaie de convertir un montant (de l'euros au dollard) que je saisie dans une cellule mais dans ma macro je ne sais pas comment déclarer montant. (Le taux est faux c'est juste à titre indicatif pour mes tests)

Dim montant As Integer
Const taux = 2

Private Sub Commande2_Click()
Dim montantdollard As Integer
montantdollard = montant * taux
MsgBox "Votre montant : " & montantdollard


End Sub


Aidez moi svp
A voir également:

1 réponse

Polux31 Messages postés 6917 Date d'inscription mardi 25 septembre 2007 Statut Membre Dernière intervention 1 novembre 2016 1 204
21 nov. 2009 à 19:00
Bonjour,

Private montant As Integer
Const taux = 2

Private Sub Commande2_Click()
Dim montantdollard As Integer

   'TextBox1 est la zone texte où est saisi le montant.
   montant = CInt(TextBox1.Text)
   montantdollard = montant * taux

   MsgBox "Votre montant : " & montantdollard

End Sub 


Ca doit le faire comme ça.

;o)
0