Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Vail, Colorado, USA
    Posts
    194
    Thanks
    36
    Thanked 0 Times in 0 Posts

    Setting Control Properties programatically (2000)

    I am creating a report using VB, its name is derived from input on a form. When I populate the report with controls and labels I want to set their properties. So far I have not been able to work out how to do so. The problem is with the Report name. When I enter Reports!rptname (the variable that carries the report name) I am told that Access cannot find the Report called "rptName". That is correct as that is the variable. I imagine the answer is simply but having tried all sorts of brackets etc. I am stumped can anyone help.

    thanks

    Peter

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Setting Control Properties programatically (2000)

    If rptName is a string variable, you should be able to use Reports(rptName). This will only work if the report is open in design or preview mode.
    If you have a control whose name is in the string variable ctlName, you can use Reports(rptName).Controls(ctlName) to refer to the control.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2003
    Location
    Vail, Colorado, USA
    Posts
    194
    Thanks
    36
    Thanked 0 Times in 0 Posts

    Re: Setting Control Properties programatically (2000)

    Hans

    That worked, thanks a lot, I knew it would be simple.

    Peter

Posting Permissions

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