Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-11-2014, 05:03 PM
scubadunc scubadunc is offline Database field cell alignment Windows 7 32bit Database field cell alignment Office 2010 32bit
Novice
Database field cell alignment
 
Join Date: Aug 2014
Posts: 6
scubadunc is on a distinguished road
Default

Appreciate all of your help Paul
Reply With Quote
  #2  
Old 08-12-2014, 05:32 PM
scubadunc scubadunc is offline Database field cell alignment Windows 7 32bit Database field cell alignment Office 2010 32bit
Novice
Database field cell alignment
 
Join Date: Aug 2014
Posts: 6
scubadunc is on a distinguished road
Default

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
Reply With Quote
  #3  
Old 08-12-2014, 08:09 PM
scubadunc scubadunc is offline Database field cell alignment Windows 7 32bit Database field cell alignment Office 2010 32bit
Novice
Database field cell alignment
 
Join Date: Aug 2014
Posts: 6
scubadunc is on a distinguished road
Default

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.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Database field cell alignment insert database as field david_89_ Mail Merge 3 03-26-2014 06:02 AM
Database field cell alignment little database gsrikanth Excel 3 06-29-2012 05:23 AM
Database field cell alignment 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

Other Forums: Access Forums

All times are GMT -7. The time now is 11:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft