Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    How to Calculate Control Name in Report

    Access 2010... I am designing a report that has a strange format! Two of the input fields are a year string like "2011" and a text string. Both input fields arrive in the report in hidden bound text boxes. I want to display the text string in the report in the unbound text box whose name corresponds to the year string with "Box" appended to it, e.g., "2011Box", "2012Box", etc. So I need to create the name of the correct unbound text box and use it in an assignment statement in the Detail Format Event (or some other event if this isn't the right one!). I haven't been able to come up with an acceptable syntax for the assignment statement.

    Is this possible? Can you tell me how to do it?

    Thanks,
    Bill

  2. #2
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post
    FYI...

    I got a reply from HansV to my question when I posted it on Eileens Lounge -- The best place to ask Access questions!

    Let's say that the bound text box containing the year is named txtYear, and the one containing the text string is named txtString. You can then use a line such as:

    Code:
        Me.Controls(Me.txtYear & "Box").Value = Me.txtString.Value
    Bill

Posting Permissions

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