Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2002
    Location
    New Zealand
    Posts
    19

    Unanswered: In A Report Print Month As Alpha not Number

    Hi
    I Have an unbound text box on a report which I want to show the month rather than the Numeric value.
    That is the report Title is "Market Totals Report for Month, where month is july august etc not the number value.
    I can get the title box ok and have a separate text box to show the month.
    I have entered in to the box =Month([Date])-1, but would like this to be the alpha month not the number.
    Thanke in Advance
    Bill

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    The only way I can see to do this is to set up a table number, month name and lookup according to the result on your report. Formatting won't work.

  3. #3
    Join Date
    Jun 2002
    Location
    Saudi Arabia / Philippines
    Posts
    126
    Bill, Hi.

    I have often achieved your requirement by using a simple self developed function. The first step is to create a function in a module. Click on Modules in the left pane of the database window and then type something like this into the VBA editor.

    Function DeriveMonthName(intMonth as Integer) as String
    Select Case intMonth
    Case 1
    DeriveMonthName = "January"
    Case 2
    DeriveMonthName = "February"
    ...
    Case 12
    DeriveMonthName = "December"
    Case Else
    DeriveMonthName = "???"
    End Select
    End Function

    Then return to your report and in the Control Source under the Data tab of your unbound text control enter

    ="Market Totals Report for " & DeriveMonthName([mymonthnumber])

    substituting your field name that contains the month number for 'mymonthnumber' I have assumed that your month number is an integer - you can change it if necessary.

    I do apologise if I have been teaching my grandmother to suck eggs but I thought I better explain in detail in case you are not familiar with modules and functions.

    Rod

  4. #4
    Join Date
    Apr 2002
    Location
    New Zealand
    Posts
    19
    I'M indebted to your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •