Results 1 to 5 of 5
  1. #1
    Russellh is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    68

    How to adjust text in title based on last 2 numbers in one of the fields

    Instead of creating 12 reports (1 for each month of the year) how would have the "month" in the report header based on the last 2 numbers in one of the fields.
    This field that I want to base it on will be in the format YYMM ex 1403 for march of 2014. So if the field reads 1403 I want it to say March if it says 1406 I want it to say June.



    Unless there is a better way of doing this. Please let me know.

    Russellh

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe something like this

    Code:
    Dim strValue As String
    Dim strAnswer As String
    strValue = 1403
    strAnswer = MonthName((Mid(strValue, 3)))
    MsgBox strAnswer

  3. #3
    Russellh is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    68
    Quote Originally Posted by ItsMe View Post
    Maybe something like this

    Code:
    Dim strValue As String
    Dim strAnswer As String
    strValue = 1403
    strAnswer = MonthName((Mid(strValue, 3)))
    MsgBox strAnswer

    I apologize for this next dumb question. Where would I insert this code?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    It is not dumb. Reports are not easy to apply variables to. If a field is available to the header section you could replace the string variable with the field and simply place an expression in an unbound text box in the header.

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I was using my phone earlier.

    Here is an example of an expression
    = MonthName((Mid(Me![FieldName],3)))

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-27-2014, 06:42 AM
  2. Replies: 3
    Last Post: 01-31-2014, 11:00 AM
  3. Replies: 3
    Last Post: 09-05-2012, 12:47 PM
  4. Transparent text box title on Form?
    By LostInAccess in forum Forms
    Replies: 5
    Last Post: 06-29-2012, 02:46 PM
  5. Replies: 0
    Last Post: 02-27-2011, 07:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums