Displaying Month on a Report

  • Thread starter Thread starter laura
  • Start date Start date
L

laura

I am trying to display just the month of any given date held in my table,
but for some reason it's not working!

A table (tblCalendar) with a date field called aDate

A report with the recordsource being the tblCalendar. I have a textbox in
which I have put in the Control Source the following:-

=Format([aDate],"mmm")

It will not display the month - why?

It works on a Form but not on a Report.

Laura TD
 
What do you mean with "It will not display the month",
does it give an error or indicate something else?
Check this one thing, make sure the name of the textbox is
not the same as a fieldname in the table or query.
When creating a textbox for a formula it is best to start
with an unbound textbox.
Hope this helps.
Fons
 
I have found you need to put the adate field on the report
as a textbox then in properties display should be no. This
is because a report field that is a calculation does not
look at your record source only fields on the current
report.

Martin
 
Martin,
Brilliant, thank you... I was foxed. I tried and tried and failed. As you
suggested, I dragged the field onto the form and then made it not visible. I
then added another unbound textbox and put the formula for Control Source =
Format(aDate,"mmm") and it worked!

Thank you so much. I didn't realise that the report fields did not calculate
on the Record Source but rather on the fields actually on the table (if I
understand you correctly).

Laura TD


martin said:
I have found you need to put the adate field on the report
as a textbox then in properties display should be no. This
is because a report field that is a calculation does not
look at your record source only fields on the current
report.

Martin
-----Original Message-----
I am trying to display just the month of any given date held in my table,
but for some reason it's not working!

A table (tblCalendar) with a date field called aDate

A report with the recordsource being the tblCalendar. I have a textbox in
which I have put in the Control Source the following:-

=Format([aDate],"mmm")

It will not display the month - why?

It works on a Form but not on a Report.

Laura TD


.
 
Dear Fons,

Thank you for your response.. sorry I was not entirely clear - was getting
so frustrated. Yes, I was getting #Error instead of the month. I have fixed
it now with the help of Martin who also responded saying I should put the
actual field on the form, but make it not visible, then do the calculation
=format(aDate,"mmm") on that field on the form. It worked. Thanks for your
help, too.

Laura TD


Fons Ponsioen said:
What do you mean with "It will not display the month",
does it give an error or indicate something else?
Check this one thing, make sure the name of the textbox is
not the same as a fieldname in the table or query.
When creating a textbox for a formula it is best to start
with an unbound textbox.
Hope this helps.
Fons
-----Original Message-----
I am trying to display just the month of any given date held in my table,
but for some reason it's not working!

A table (tblCalendar) with a date field called aDate

A report with the recordsource being the tblCalendar. I have a textbox in
which I have put in the Control Source the following:-

=Format([aDate],"mmm")

It will not display the month - why?

It works on a Form but not on a Report.

Laura TD


.
 
Back
Top