probleme de date

petchy

XLDnaute Occasionnel
bonsoir
voila j'ai un petit probleme avec un format date
depuis mon programme que j'ai fait en VB6,j'envoi des données vers excel
et dans une cellule je reçois une date de naissance
dans le prog j'ai 02/07/2007
dans excel je reçois 07/02/2007,j'ai regarder le format de la cellule et j'ai mis format personalisée jj/mm/aaaa,mais c'est toujours pareil.
auriez vous une idée
merci
 

JCGL

XLDnaute Barbatruc
Re : probleme de date

Bonjour à tous,
Salut Petchy :),

Ton problème est récurent sur les imports.
Il te faut inverser les jours et les mois... mais tu risques d'avoir des soucis pour les dates après ou avant le 12 du mois.

Ton import en *.txt pourrait nous aider à t'aider.

A++
A+ à tous
 

petchy

XLDnaute Occasionnel
Re : probleme de date

salut JCGL

merci pour ta réponse
en, fait je n'importe pas en .txt mais en dur
voila mon code
Private Sub cmdimprimerexcel_Click()
Dim Max As Integer
Dim geré As String

If nouv = True Then
'-- cherche la cle la plus eleve de la table
Set rs = New ADODB.Recordset
rs.Open "select max(Num_ctr) as nouv from centre_aéré", Db
If IsNumeric(rs!nouv) = False Then
Max = 1
Else
Max = rs!nouv + 1
End If
rs.Close



'ajout article
requete = "INSERT INTO centre_aéré (PR, CO, AC, PSA, CBV, " _
& "CPV, CTT, MSA, NBCL, rbg, np, matri) VALUES " _
& "(" & Max & ",""" & t18 & """,""" & Text1(9) & """," _
& """" & Text1(10) & """,""" & TextBox1 & """,""" & Text1(2) & """," _
& """" & Text1(3) & """,""" & Text1(4) & """,""" & Text1(5) & """,""" & Text1(0) & """,""" & re(26) & """,""" & re(27) & """,""" & Text1(12) & """)"






Db.Execute requete
requete = ""





Else 'modif

requete = "UPDATE centre_aéré SET " _
& "PR=""" & t18 & """, CO = """ & Text1(9) & """," _
& "AC=""" & Text1(10) & """, CBV=""" & Text1(2) & """," _
& " CPV=""" & Text1(3) & """, CTT=""" & Text1(4) & """," _
& "MSA=""" & Text1(5) & """, NBCL=""" & Text1(0) & """," _
& "PSA=""" & TextBox1 & """, rbg=""" & re(26) & """, np=""" & re(27) & """, matri=""" & Text1(12) & """ WHERE Num_ctr=" & Codepsa & ""




Db.Execute requete
requete = ""



'rs!fiche = fiche
'


End If

frmSplash2.Show
frmSplash2.Timer1 = True
'********Déclaration de l'pplication excel aprés avoir réferencer la dll de excel********
Set ApExcel = CreateObject("excel.application")
With ApExcel
.Visible = True
.Workbooks.Open App.Path & "\BD\centre.xls" '********Ouvrir le classeur excel **********'
If TextBox1.Text > 0 And Label1(0).Caption = 0 Then
.Range("E13").Value = Label12.Caption
Else
.Range("E13").Value = ""
End If
'End If
.Range("E1").Value = fiche.Caption 'entete
.Range("E3").Value = Label2(2).Caption 'pere
.Range("E4").Value = Label2(4).Caption 'mere
.Range("E5").Value = Label2(3).Caption 'emploi
.Range("E6").Value = Label2(5).Caption 'adresse
.Range("I6").Value = Label2(6).Caption 'commune
.Range("E7").Value = Label2(1).Caption 'tel fix
.Range("I7").Value = Label2(0).Caption 'tel port
.Range("D22").Value = Label3(12).Caption 'caf
.Range("D26").Value = Label3(7).Caption 'nom enfant
'.Range("G25").Value = Label3(8).Caption 'prenom enfant
.Range("J26").Value = Label3(9).Caption 'date de naisance
.Range("L26").Value = Label3(10).Caption 'age
.Range("J27").Value = Label3(11).Caption 'sexe
.Range("L33").Value = Label3(20).Caption 'cantine
.Range("E37").Value = Label6(3).Caption 'prix par journée
.Range("G38").Value = Text1(49).Text 'observation
.Range("G22").Value = Text1(12).Text 'autres N°
.Range("D30").Value = excel1.Label3(1).Caption '1 semaine total
.Range("D31").Value = excel1.Label3(0).Caption '2 semaine total
.Range("D32").Value = excel1.Label3(2).Caption '3 semaine total
.Range("D33").Value = excel1.Label3(3).Caption '4 semaine total
.Range("G30").Value = excel1.Label3(4).Caption '5 semaine total
.Range("G31").Value = excel1.Label3(5).Caption '6 semaine total
.Range("G32").Value = excel1.Label3(6).Caption '7 semaine total
.Range("G33").Value = excel1.Label3(21).Caption '8 semaine total
.Range("F30").Value = excel1.Label3(13).Caption '1 semaine total
.Range("F31").Value = excel1.Label3(14).Caption '2 semaine total
.Range("F32").Value = excel1.Label3(15).Caption '3 semaine total
.Range("F33").Value = excel1.Label3(16).Caption '4 semaine total
.Range("K30").Value = excel1.Label3(17).Caption '5 semaine total
.Range("K31").Value = excel1.Label3(18).Caption '6 semaine total
.Range("K32").Value = excel1.Label3(19).Caption '7 semaine total
.Range("K33").Value = excel1.Label3(22).Caption '8 semaine total
.Range("F34").Value = excel1.Label3(23).Caption '4 semaine total
.Range("D11").Value = t18.Text 'prix réel
.Range("E11").Value = Text1(9).Text 'commune part
.Range("F11").Value = Text1(10).Text 'autre CE
.Range("G11").Value = Text1(11).Text 'PSA
.Range("H11").Value = Text1(2).Text 'CAF BV
.Range("I11").Value = Text1(3).Text 'CAF CV
.Range("J11").Value = Text1(4).Text 'CAF TT
.Range("K11").Value = Text1(5).Text 'MSA
.Range("L11").Value = Label4(0).Caption 'Prix
.Range("M11").Value = Label4(2).Caption 'total PSA 1
.Range("N11").Value = Label4(1).Caption 'total PSA 2
.Range("D17").Value = Text1(13).Text 'immatriculation
.Range("E17").Value = re(26).Text 'revenu brut
.Range("G17").Value = re(27).Text 'Nombre de parts
.Range("I17").Value = Label4(3).Caption 'tranche
.Range("L17").Value = Label1(0).Caption 'SNCF
.Range("F37").Value = Label1(1).Caption 'SNCF1
.Range("I40").Value = Label5(5).Caption 'prix total
.Range("I41").Value = Label5(4).Caption 'total chèques vacances
.Range("I42").Value = Label5(3).Caption 'somme à verser
.Range("I12").Value = Text1(3).Text 'prix chèques vacances
.Range("D15").Value = Text4.Text 'nombres de chèques vacances
.Range("E38").Value = Label6(0).Caption 'JUILLET
.Range("E39").Value = Label6(1).Caption 'AOUT
.Range("f38").Value = Label6(2).Caption 'addition jours sncf
.Range("E40").Value = Text1(14).Text 'CANTINE
.Range("E41").Value = Text1(15).Text 'PRIX SNCF
.Range("E9").Value = Text5(0).Text 'prix commune
.Range("H9").Value = Text5(2).Text 'prix caf bv
.Range("K9").Value = Text5(3).Text 'prix MSA
.Range("L9").Value = Text5(4).Text 'M11
.Range("I9").Value = Text5(1).Text 'prix caf CV
'End If
End With
Set appExcel = Nothing

excel1.Hide
sncf.Hide
End Sub
mais ,quand j'envoi vers excel je ne fait pas de calcul,donc si il exeite une formule pour inverser la date à la reception de la date dans excel je suis preneur
merci
 

petchy

XLDnaute Occasionnel
Re : probleme de date

Re

oui,les dates provienne bien de ma base Access,mais de se coté la pas de probleme mes dates sont bien dans l'ordre.
voila se que je reçois dans ma form
Private Sub Form_Activate()
fiche.Caption = "Fiche d'inscription pour l'année " & Year(Now)
Dim i As Long
For i = 0 To sncf.Text2.Count - 1
sncf.Text2(i).Visible = False
Next
For i = 0 To sncf.Label3.Count - 1
sncf.Label3(i).Visible = False
Next
sncf.Image1.Visible = False
sncf.Frame1.Visible = False
sncf.T1(0).Visible = False
sncf.T1(1).Visible = False
sncf.T1(2).Visible = False
sncf.Text3(4).Visible = False
sncf.Text3(5).Visible = False
sncf.valid.Visible = False
Image3.Visible = False
Picture1.Visible = False
Text1(0).Text = Frm_Visu.L8(8).Caption
Text1(2).Text = Frm_Visu.L8(4).Caption
Text1(3).Text = Frm_Visu.L8(5).Caption
Text1(4).Text = Frm_Visu.L8(6).Caption
Text1(5).Text = Frm_Visu.L8(7).Caption
Text1(12).Text = Frm_Visu.L8(11).Caption
t18.Text = Frm_Visu.L8(0).Caption
Text1(9).Text = Frm_Visu.L8(1).Caption
Text1(10).Text = Frm_Visu.L8(2).Caption
TextBox1.Text = Frm_Visu.L8(3).Caption
Text1(14).Text = Frm_Visu.L2(9).Caption
Text1(15).Text = Frm_Visu.L2(10).Caption
Label1(0).Caption = sncf.T1(31).Text & " €"
'Label4(3).Caption = sncf.T1(32).Text
Me.Caption = "fiche de " & Frm_Accueil.Text1 & ""
Label3(7).Caption = Frm_Accueil.Text1.Text 'nom
Label2(2).Caption = Frm_Visu.rensei(2).Text 'pere
'Label3(8).Caption = Frm_Visu.rensei(1).Text 'prénom
Label2(4).Caption = Frm_Visu.rensei(3).Text 'mere
Label3(9).Caption = Frm_Visu.rensei(8).Text 'date de naissance
Label3(10).Caption = Frm_Visu.Text1.Text 'age
Label3(11).Caption = Frm_Visu.rensei(7).Text 'sexe
Label3(12).Caption = Frm_Visu.Txt_caf.Text 'caf
Label2(5).Caption = Frm_Visu.rensei(4).Text 'adresse
If Frm_Visu.M1.Text = "--/--/--/--/--" Then 'tel fixe
Label2(1).Caption = ""
Else
Label2(1).Caption = Frm_Visu.M1.Text 'tel fixe
End If
If Frm_Visu.M2.Text = "--/--/--/--/--" Then 'tel portable
Label2(0).Caption = ""
Else
Label2(0).Caption = Frm_Visu.M2.Text 'tel portable
End If
Label2(3).Caption = Frm_Visu.rensei(6).Text 'emploi
Label2(6).Caption = Frm_Visu.rensei(5).Text 'commune
Label3(0).Caption = Frm_Visu.TX5(1).Text '& Frm_Visu.L2(1).Caption 'semaine 1
Label3(1).Caption = Frm_Visu.TX5(0).Text '& Frm_Visu.L2(0).Caption 'semaine 2
Label3(2).Caption = Frm_Visu.TX5(2).Text '& Frm_Visu.L2(2).Caption 'semaine 3
Label3(3).Caption = Frm_Visu.TX5(3).Text '& Frm_Visu.L2(3).Caption 'semaine 4
Label3(4).Caption = Frm_Visu.TX5(4).Text '& Frm_Visu.L2(4).Caption 'semaine 5
Label3(5).Caption = Frm_Visu.TX5(5).Text '& Frm_Visu.L2(5).Caption 'semaine 6
Label3(6).Caption = Frm_Visu.TX5(6).Text '& Frm_Visu.L2(6).Caption 'semaine 7
Label3(21).Caption = Frm_Visu.TX5(7).Text '& Frm_Visu.L2(7).Caption 'semaine 8
Label3(20).Caption = Frm_Visu.comb_cant.Text 'cantine
Label3(13).Caption = Frm_Visu.tx4(0).Text '& " jours" 'semaine 1
Label3(14).Caption = Frm_Visu.tx4(1).Text 'semaine 2
Label3(15).Caption = Frm_Visu.tx4(2).Text 'semaine 3
Label3(16).Caption = Frm_Visu.tx4(3).Text 'semaine 4
Label3(17).Caption = Frm_Visu.tx4(4).Text 'semaine 5
Label3(18).Caption = Frm_Visu.tx4(5).Text 'semaine 6
Label3(19).Caption = Frm_Visu.tx4(6).Text 'semaine 7
Label3(22).Caption = Frm_Visu.tx4(7).Text 'semaine 8
Label3(23).Caption = Frm_Visu.tx4(8).Text 'semaine 8
End Sub
sinon je ne comprends pas ta réponse
merci
 

Discussions similaires

Statistiques des forums

Discussions
312 508
Messages
2 089 140
Membres
104 047
dernier inscrit
bravetta