edderic
Programmer
- May 8, 1999
- 628
Hello,
i open and run a Access report from Visual Basic :
Public Sub ToonVanDatum()
Dim sVanDatum As Date
Dim sTotDatum As Date
On Error GoTo fout
sVanDatum = FormatDateTime(DTPvanDatum.Value, vbShortDate)
sVanDatum = Format(sVanDatum, "mm,dd,yyyy"
sTotDatum = FormatDateTime(DTPtotDatum.Value, vbShortDate)
sTotDatum = Format(sTotDatum, "mm,dd,yyyy"
Set ac = New Access.Application
ac.OpenCurrentDatabase App.Path & "\Cycle.mdb"
ac.DoCmd.Maximize
ac.DoCmd.OpenReport "Kasboek", acViewPreview, , "DatumCorrectie >=#" & sVanDatum & "#" & " And DatumCorrectie <=#" & sTotDatum & "#"
ac.DoCmd.RunCommand acCmdZoom100
ac.Visible = True
Exit Sub
fout:
Set ac = Nothing
End Sub
I will no the access function DSum on the Where connections !?
acc.DSum etc... Where "DatumCorrectie < #" & sVanDatum & "#"
ho fix ik that?
Thanks
Belgium programmer.
Eric De Decker
eric.de.decker@pandora.be
i open and run a Access report from Visual Basic :
Public Sub ToonVanDatum()
Dim sVanDatum As Date
Dim sTotDatum As Date
On Error GoTo fout
sVanDatum = FormatDateTime(DTPvanDatum.Value, vbShortDate)
sVanDatum = Format(sVanDatum, "mm,dd,yyyy"
sTotDatum = FormatDateTime(DTPtotDatum.Value, vbShortDate)
sTotDatum = Format(sTotDatum, "mm,dd,yyyy"
Set ac = New Access.Application
ac.OpenCurrentDatabase App.Path & "\Cycle.mdb"
ac.DoCmd.Maximize
ac.DoCmd.OpenReport "Kasboek", acViewPreview, , "DatumCorrectie >=#" & sVanDatum & "#" & " And DatumCorrectie <=#" & sTotDatum & "#"
ac.DoCmd.RunCommand acCmdZoom100
ac.Visible = True
Exit Sub
fout:
Set ac = Nothing
End Sub
I will no the access function DSum on the Where connections !?
acc.DSum etc... Where "DatumCorrectie < #" & sVanDatum & "#"
ho fix ik that?
Thanks
Belgium programmer.
Eric De Decker
eric.de.decker@pandora.be