Results 1 to 5 of 5
  1. #1
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I have just noticed that the subform/subreport wizard allows you to put a form in a report, but not to put a report in a form.
    Is there any way around this?

    I would like to display a preview of an Mailing Label within a form that has contact details for a person.
    I have a job where a lot of data is being imported from various Excel spreadsheets, and the data is full of inconsistencies etc. My attempts to get the client to 'clean' the data within Excel have not been very successful, so my next strategy is to import into a temporary database and do the cleaning there.
    I thought a preview of an Address Label might help. I can nearly get what I want, but blank lines are not suppressed.

    [attachment=83930:addressblock.gif]
    Attached Images Attached Images
    Regards
    John



  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    When a report is previewed, it is formatted as if it's going to be printed. This wouldn't make sense if you embedded the report in a form, so it is not possible to use a report as a subform.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Thanks. that is what I expected.
    Regards
    John



  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Note however that you can make a form "look" like a report, so your client will think they are looking at a sample mailing label. To do that you can either use a simple text box sized to a mailing label size, or you can put it on a subform. As to the issue of blank lines, you can create an expression that will have the same effect. For example:

    [PersonName] & vbCR & vbLF & iif(isnull([StreetAddress1]),null,[StreetAddress1] & vbCR & vbLF) & iif(isnull([StreetAddress2]),Null,[StreetAddress2] & vbCR & vbLF) & [CityName] & ", " & [StateName] & " " & [PostCode]

    You could create the expression as the data property of the text box control, but I would probably put it into the query that serves as the data source for the form. And I would lock the control so the user doesn't try to edit the data there.

    (BTW, I've never been to Bendigo, but my wife has - I had to work while she played.)
    Wendell

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Thanks for the suggestion.
    My query already organised the data by line so this expression pulled it all together:

    =[line1] & ((Chr(13) & Chr(10))+[Line2]) & ((Chr(13) & Chr(10))+[Line3]) & ((Chr(13) & Chr(10))+[Line4]) & ((Chr(13) & Chr(10))+[Line5]) & ((Chr(13) & Chr(10))+[Line6]) & ((Chr(13) & Chr(10))+[Line7])

    The + signs mean that blank lines are suppressed.

    This job is based in Bendigo, which is about an hour up the road from me.
    Regards
    John



Posting Permissions

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