Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2010
    Posts
    20

    Unanswered: Aligning and summing elements through VBA Code

    Hello,

    I've finally succeeded building a report through code (and when I'll have time I'll post a demo of what I did), but I have 2 minor problems:

    1. Alignment of the elements on the report - Is there any way I can control Alignment through VBA? Right now the column names and data are off-sided and that is not very "representable" to my users (see attached jpg). I can use alignment on each databox, as the report template is empty and the textboxes are created from code, right before the preview.

    2. Sum of elements: Is there any way I can do it through VBA as well ? As with the alignment I can't make a static sum refering to a fixed field (as I used to do until now: a textbox with =sum() or =count() ), as I don't know which field the users will chose from the options they have.

    Thanks,

    Adnaket
    Attached Thumbnails Attached Thumbnails report.jpg  

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Have you examined the properties of the relevant controls?
    IIRC it is possible to move controls using VBA code so it should be possible to adjust the position of controls
    so it should be possible to adjust the alignment as well

    what stopping you adding other controls and set the values appropriately
    you coudl do that by either running a SQL query and settign the value of the controls to the output of that query

    or if the data is already being retrieved do the summation/count in the report formatting. you may need to use static/global (to the report) variables
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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