![]() |
|
|
|
#1
|
|||
|
|||
|
Appreciate all of your help Paul
|
|
#2
|
|||
|
|||
|
Hi again Paul
Quick question..Is it possible to do nested database fields? In my example above, I would like to total the subscription.Price field and nest the following code into the existing so the total aligns with the subscription.Price field in the outputted table. DATABASE \d "C:\\database\\test.mdb" \c "DSN=MS Access Database; DBQ= C:\\database\\test.mdb;FIL=MS Access" \s " SELECT Format(sum(subscription.Price), '$#,###.00') FROM subscription WHERE (((subscription.ConstID)='3992'))" If that isn't possible, can you think of another way to achieve this? I do have the subscription total calculated in a separate field also. My main concern is aligning the total to the subscription.Price column |
|
#3
|
|||
|
|||
|
Hi Paul
Found a workaround for the time being...merge to a new document then use a couple of macros to search for a 7 column table...autofit it to window and then right align column 7...Then I just have a separate right aligned total field. Sub ResizeTable() Dim oTbl As Table For Each oTbl In ActiveDocument.Tables With oTbl If .Columns.Count = 7 Then .AutoFitBehavior Behavior:=wdAutoFitWindow End If End With Next oTbl End Sub Sub RightAlignColumn7() Dim oTable As Table Dim oCol As Column Dim oCell As Cell For Each oTable In ActiveDocument.Tables For Each oCol In oTable.Columns If oCol.Index = 7 Then For Each oCell In oCol.Cells oCell.Range.ParagraphFormat.Alignment _ = wdAlignParagraphRight Next End If Next Next End Sub Last edited by scubadunc; 08-12-2014 at 10:44 PM. |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
insert database as field
|
david_89_ | Mail Merge | 3 | 03-26-2014 06:02 AM |
little database
|
gsrikanth | Excel | 3 | 06-29-2012 05:23 AM |
table cell alignment issue
|
gib65 | Word | 1 | 06-02-2012 03:03 PM |
| Vertical Alignment of Text and Label Field | jslist@sbcglobal.net | Word | 0 | 04-16-2010 12:20 PM |
| Text Wrapping on Fixed Lines in a Form field/Table cell | okrmjr | Word Tables | 0 | 10-30-2009 08:52 AM |