Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    58

    Unanswered: Automatically update labels

    I have a large number of reports that all have the same label caption. This label will need to be changed at certain intervals. What I want to do is have a label setup on a form which when the caption is changed all the relevant labels on the reports will display the same info.

    I have tried using the following expression on the labels in the reports:

    =[Forms]![Menu_frm]![Date_lbl].[Caption]

    but this only works when the Menu_frm is open, when it is closed the reports display #Name?

    Is there an easy way to set it up so all the reports display the same captions as entered on the form without the form having to be accessed first?

  2. #2
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: Automatically update labels

    Originally posted by HilcrRWise
    I have a large number of reports that all have the same label caption. This label will need to be changed at certain intervals. What I want to do is have a label setup on a form which when the caption is changed all the relevant labels on the reports will display the same info.

    I have tried using the following expression on the labels in the reports:

    =[Forms]![Menu_frm]![Date_lbl].[Caption]

    but this only works when the Menu_frm is open, when it is closed the reports display #Name?

    Is there an easy way to set it up so all the reports display the same captions as entered on the form without the form having to be accessed first?

    An easy way, is to create a public variable in a standard module that you update from code when you change the label. The report's Open event can be used to access this variable.

    You could store the current value in a table and use the DLookup function in the control source of a textbox on each report. You would have to use a textbox to have access to a control source though.

    You could also use the Open event of each report with a label and again use the DLookup function to supply the value for the caption of the label.

    If you want to persist the value from session to session though, I think that I would consider using a table to store the value.

    There are a multitude of solutions I'm sure but those are the easiest that come to mind for me if your form is not going to be open at the time of report viewing.

    Hope this helps get you on track.

    Gregg

Posting Permissions

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