Trying to get MonthName to work in report

got_access:]

Registered User.
Local time
Today, 14:10
Joined
Jun 15, 2018
Messages
83
Hi All,
I have a table having a field named "MonthNum" - datatype is integer.
It holds numbers from 1-12

I can use the MonthName function in a query to get the name of the month using this field. However, when I try to do the same thing in a report - where MonthNum is a field in the report - I keep getting a #Type error. MonthNum will display all by itself but I get the #Type error if I try to use it within the MonthName formula.

BTW: Out of curiosity I also tried the Isnumeric function on this MonthNum value.
And instead of getting a "True" vs "False" response it displays a zero.
I can't figure out why a function would work in a query but not in a report.

Anyone seen this before?
And how do I trouble shoot this?
 
Why not add a second field MonthName in your table and just reference that?

As for your true/false question, 0=false. That suggests your MonthNum field is a text field or perhaps that you are using a lookup field at table level.

Answering on my phone so unable to test the other points you raised.
 
One possible issue with reports is having a control with the same name as a field, which is unfortunately what the wizard does. Make sure no textbox or other control has the name "MonthNum" and see if that resolves the issue.
 
Do the MonthName calc in query used as report RecordSource. Bind textbox to that field.
 
Thanks everyone for your great responses.
I did end up adding the MonthName into the table.
But I especially didn't know about the issue with a field in a report having the same name as a field in the table. So I'll definitely follow up on that.

Many thanks!:)
 

Users who are viewing this thread

Back
Top Bottom