06-28-10, 03:36 #1Registered User
- Join Date
- Apr 2010
Unanswered: Aligning and summing elements through VBA Code
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.
06-28-10, 06:10 #2Jaded Developer
Provided Answers: 59
- Join Date
- Nov 2004
- out on a limb
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) variablesI'd rather be riding on the Tiger 800 or the Norton