Results 1 to 4 of 4

Thread: Pass Variable to a Datareport

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026

    Pass Variable to a Datareport

    How can I pass a string variable to a datareport? I have a label called "lblAddress", and I want to parse the customer's address so it looks more like:

    123 Some Street, SomeTown 12345

    instead of:

    123 Some Street SomeTown 12345

    I know how to do the parsing bit, but I can't find how to get it into the datareport.

    Thank you for your help,

    Squirrelly1
    Now happily married and still crankin' away at the keyboard. Life is grand for a coder, no?

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    I don't use DataReports but I think you can treat it like any other VB form, i.e. just set the caption property of the address label.
    VB Code:
    1. DataReport1.lblAddress.Caption = strFormattedAddress

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2001
    Location
    USA
    Posts
    1,026
    it doesn't seem to give me that option....
    Now happily married and still crankin' away at the keyboard. Life is grand for a coder, no?

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    You access the objects through the Sections and Controls collections of the DataReport object.

    DataReport1.Sections("Section1").Controls("Label1").Caption = ...

    Of course, change the Section1 and Label1 to suit your needs.

Posting Permissions

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



Click Here to Expand Forum to Full Width