Zone de texte s'affiche le mois...:______" MSFl
accent19811
Messages postés
149
Statut
Membre
-
f894009 Messages postés 17417 Date d'inscription Statut Membre Dernière intervention -
f894009 Messages postés 17417 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Affiche une date + NUM + Prix sur " MSFlexGrid1" V.B6
Mais à condition..:
Elle un zone de texte s'affiche le mois...:______
-Date doit répéter à partir de "nombre mois".
Si le zone texte "mois" égal par exemple: 10.
Donc Num dans liste s'affiche: 1 jusqu'à 10.
-Chaque fois la date plus 30 jours.
Voir exemple suivant..:
Num.....: Date.......: Prix.......:
01---- 15/01/2012----500.00
02---- 15/02/2012----500.00
03---- 15/03/2012----500.00
04---- 15/04/2012----500.00
05---- 15/05/2012----500.00
...
...
...
10----15/10/2012----500
Affiche une date + NUM + Prix sur " MSFlexGrid1" V.B6
Mais à condition..:
Elle un zone de texte s'affiche le mois...:______
-Date doit répéter à partir de "nombre mois".
Si le zone texte "mois" égal par exemple: 10.
Donc Num dans liste s'affiche: 1 jusqu'à 10.
-Chaque fois la date plus 30 jours.
Voir exemple suivant..:
Num.....: Date.......: Prix.......:
01---- 15/01/2012----500.00
02---- 15/02/2012----500.00
03---- 15/03/2012----500.00
04---- 15/04/2012----500.00
05---- 15/05/2012----500.00
...
...
...
10----15/10/2012----500
A voir également:
- Zone de texte s'affiche le mois...:______" MSFl
- Alternative zone telechargement - Accueil - Outils
- Le clavier de mon telephone ne s'affiche plus - Guide
- Youtube premium 2 mois gratuit - Accueil - TV & Vidéo
- Traitement de texte gratuit - Guide
- Texte de barra - Guide
1 réponse
re
'Affiche une date + NUM + Prix sur " MSFlexGrid1" V.B6
'Mais à condition..:
'Elle un zone de texte s'affiche le mois...:______
'-Date doit répéter à partir de "nombre mois".
'Si le zone texte "mois" égal par exemple: 10.
'Donc Num dans liste s'affiche: 1 jusqu'à 10.
'-Chaque fois plus 30 jours.
'Voir exemple suivant..:
'01---- 15/01/2012----500.00
'02---- 15/02/2012----500.00
'03---- 15/03/2012----500.00
'04---- 15/04/2012----500.00
'05---- 15/05/2012----500.00
Option Explicit
Dim Nb_Mois As Integer
Private Sub Form_Load()
MSFlexGrid1.Visible = False
Text1.Text = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
'Controle chiffres
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 13 Then KeyAscii = 8
'Controle CR et un nombre
If KeyAscii = 13 And Text1.Text <> "" Then
Nb_Mois = CInt(Text1.Text)
'raz textbox
Text1.Text = ""
If Nb_Mois > 0 Then
Call Rempli_MSFlex
End If
End If
Text1.SetFocus
End Sub
Private Sub Rempli_MSFlex()
Dim Date_Maintenant, Date_Mois_Suivant, i
MSFlexGrid1.Visible = True
'MSFlexGrig a 2 colonnes et 6 ligne (Titre + 5 mois)
Me.MSFlexGrid1.Clear
Me.MSFlexGrid1.Cols = 4
MSFlexGrid1.Rows = Nb_Mois + 1
Date_Maintenant = Now
Date_Mois_Suivant = Date_Maintenant
' Ecriture du titre Colonne1
With MSFlexGrid1
.TextMatrix(0, 1) = "Num"
.TextMatrix(0, 2) = "Date"
.TextMatrix(0, 3) = "Prix"
'Ecriture Date Aujourd'hui Colonne1
.TextMatrix(1, 1) = "01"
.TextMatrix(1, 2) = Format(Date_Mois_Suivant, "DD/MM/YYYY")
.TextMatrix(1, 3) = "500.00"
'ecriture quatre mois suivants
For i = 2 To Nb_Mois
.TextMatrix(i, 1) = Format(i, "00")
Date_Mois_Suivant = Format(DateAdd("m", 1, Date_Mois_Suivant), "dd/mm/yyyy")
.TextMatrix(i, 2) = Format(Date_Mois_Suivant, "DD/MM/YYYY")
.TextMatrix(i, 3) = "500.00"
Next i
End With
End Sub
Entrez le nombre de mois dans la zone de texte
Bonne suite
'Affiche une date + NUM + Prix sur " MSFlexGrid1" V.B6
'Mais à condition..:
'Elle un zone de texte s'affiche le mois...:______
'-Date doit répéter à partir de "nombre mois".
'Si le zone texte "mois" égal par exemple: 10.
'Donc Num dans liste s'affiche: 1 jusqu'à 10.
'-Chaque fois plus 30 jours.
'Voir exemple suivant..:
'01---- 15/01/2012----500.00
'02---- 15/02/2012----500.00
'03---- 15/03/2012----500.00
'04---- 15/04/2012----500.00
'05---- 15/05/2012----500.00
Option Explicit
Dim Nb_Mois As Integer
Private Sub Form_Load()
MSFlexGrid1.Visible = False
Text1.Text = ""
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
'Controle chiffres
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 13 Then KeyAscii = 8
'Controle CR et un nombre
If KeyAscii = 13 And Text1.Text <> "" Then
Nb_Mois = CInt(Text1.Text)
'raz textbox
Text1.Text = ""
If Nb_Mois > 0 Then
Call Rempli_MSFlex
End If
End If
Text1.SetFocus
End Sub
Private Sub Rempli_MSFlex()
Dim Date_Maintenant, Date_Mois_Suivant, i
MSFlexGrid1.Visible = True
'MSFlexGrig a 2 colonnes et 6 ligne (Titre + 5 mois)
Me.MSFlexGrid1.Clear
Me.MSFlexGrid1.Cols = 4
MSFlexGrid1.Rows = Nb_Mois + 1
Date_Maintenant = Now
Date_Mois_Suivant = Date_Maintenant
' Ecriture du titre Colonne1
With MSFlexGrid1
.TextMatrix(0, 1) = "Num"
.TextMatrix(0, 2) = "Date"
.TextMatrix(0, 3) = "Prix"
'Ecriture Date Aujourd'hui Colonne1
.TextMatrix(1, 1) = "01"
.TextMatrix(1, 2) = Format(Date_Mois_Suivant, "DD/MM/YYYY")
.TextMatrix(1, 3) = "500.00"
'ecriture quatre mois suivants
For i = 2 To Nb_Mois
.TextMatrix(i, 1) = Format(i, "00")
Date_Mois_Suivant = Format(DateAdd("m", 1, Date_Mois_Suivant), "dd/mm/yyyy")
.TextMatrix(i, 2) = Format(Date_Mois_Suivant, "DD/MM/YYYY")
.TextMatrix(i, 3) = "500.00"
Next i
End With
End Sub
Entrez le nombre de mois dans la zone de texte
Bonne suite