format function in report control won't work

G

Guest

in my report there are two controls which i use to delimit the beginning and
end dates for which the report was generated, "Audit Report between date1 And
date2".

my control source for the first is Forms![Print Report].Earliest and for the
2nd one is Forms![Print Report].Latest where "Print Report" is a modal form
which the user accesses from the switchboard and into which he inputs his
designees for earliest and latest ranges of his report.

the fly in this is that the dates are being displayed in mm/dd/yy style on
the report. and yet the Format is "Medium Date" for the pair of text controls
i'm talking about.

i have tried something like writing

Format(Forms![Print Report].Earliest,"dd-mmm-yyyy")

on the assumption that the Format function would operate on the date
quantity and display it per my spec's and various permutations none of which
are satisfying whatever's making this work or not.

has anyone run into this?
 
M

Marshall Barton

Ted said:
in my report there are two controls which i use to delimit the beginning and
end dates for which the report was generated, "Audit Report between date1 And
date2".

my control source for the first is Forms![Print Report].Earliest and for the
2nd one is Forms![Print Report].Latest where "Print Report" is a modal form
which the user accesses from the switchboard and into which he inputs his
designees for earliest and latest ranges of his report.

the fly in this is that the dates are being displayed in mm/dd/yy style on
the report. and yet the Format is "Medium Date" for the pair of text controls
i'm talking about.

i have tried something like writing

Format(Forms![Print Report].Earliest,"dd-mmm-yyyy")

on the assumption that the Format function would operate on the date
quantity and display it per my spec's and various permutations none of which
are satisfying whatever's making this work or not.

has anyone run into this?


That looks like it should work unless something is
converting the dates to text strings.

If you can't find where that's happening, try using:

Format(CDate(Forms![Print Report].Earliest,"dd-mmm-yyyy"))
 
G

Guest

hi marsh,

it prob'y would've helped if i'd included an "=" symbol as in

=Format(Forms![Print Report].Earliest,"dd-mmm-yyyy") or

=Format(Forms![Print Report].Earliest,"Medium Date")

suffice it to say, it works now.

many thanks for your bandwidth and concern.

peace,

-ted

Marshall Barton said:
Ted said:
in my report there are two controls which i use to delimit the beginning and
end dates for which the report was generated, "Audit Report between date1 And
date2".

my control source for the first is Forms![Print Report].Earliest and for the
2nd one is Forms![Print Report].Latest where "Print Report" is a modal form
which the user accesses from the switchboard and into which he inputs his
designees for earliest and latest ranges of his report.

the fly in this is that the dates are being displayed in mm/dd/yy style on
the report. and yet the Format is "Medium Date" for the pair of text controls
i'm talking about.

i have tried something like writing

Format(Forms![Print Report].Earliest,"dd-mmm-yyyy")

on the assumption that the Format function would operate on the date
quantity and display it per my spec's and various permutations none of which
are satisfying whatever's making this work or not.

has anyone run into this?


That looks like it should work unless something is
converting the dates to text strings.

If you can't find where that's happening, try using:

Format(CDate(Forms![Print Report].Earliest,"dd-mmm-yyyy"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top