Trying to get MonthName to work in report (1 Viewer)

got_access:]

Registered User.
Local time
Today, 01:06
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?
 

isladogs

MVP / VIP
Local time
Today, 09:06
Joined
Jan 14, 2017
Messages
18,209
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.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 01:06
Joined
Aug 30, 2003
Messages
36,124
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.
 

June7

AWF VIP
Local time
Today, 00:06
Joined
Mar 9, 2014
Messages
5,466
Do the MonthName calc in query used as report RecordSource. Bind textbox to that field.
 

got_access:]

Registered User.
Local time
Today, 01:06
Joined
Jun 15, 2018
Messages
83
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

Top Bottom