Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Label at top of report (access97)

    Please can anyone tell me how to control the contents of a label on a report from VBA ?

    I have a form that allows a user to select a datasource for a report. How can i change the label caption in the report header to show the origin of the data ? I cant use the query name as this is not descriptive enough for the report recipients.

    i have tried me.myLabel.caption = "Data from southern region" in the report_open procedure but get an error.

    Help !

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Label at top of report (access97)

    What error are you getting? I can't see anything wrong with that syntax as posted.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Label at top of report (access97)

    When the report runs i get...
    Run Time Error 2448
    You cant assign a value to this object
    *...read only form...
    *...object on form in design mode...
    *...value too large...

    is this because the report is open in preview mode ?

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Cornwall, England
    Posts
    393
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Label at top of report (access97)

    Rory, i have sorted this now

    I have placed the code in the PageHeader_Format event and it works fine.

    I expect this is what you would have suggested to try next ?

    Thanks for the input.

Posting Permissions

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