Solved

double underline

Posted on 2004-04-01
8
1,175 Views
Last Modified: 2012-08-14
Hi, this sounds like a very stupid question, but I can't figure it out.  How does one double-underline a font in a report in Access?  I'm doing some reports for our accounting department and insist on two rather than one line.  Some of my totals text boxes need to display the results with two lines underneath.

I don't want to just draw an extra line, since the number length changes and a fixed length line would look lame.

Thanks for your help.

Mirek
0
Comment
Question by:drozdzowski
  • 4
  • 3
8 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 10733216
I'm afraid you'll have to use an extra line to mimic this as a textbox will only allow a single underline :-(
Another option might be to use an extra field and place as many "=" characters as characters in the number field....

Nic;o)
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10733245
Hmm, an another alternative might be to use a Word Mailmerge to publish the report as a Word document and apply the double underline there.

Nic;o)
0
 

Author Comment

by:drozdzowski
ID: 10733277
word is not really and option.  the accounting people want the interface to all the reports simple (i.e. only one :).  is there a way to read the length of the string/number in  a text box and they apply that parameter to dynamically draw a horizontal line at run time?
0
 
LVL 77

Accepted Solution

by:
peter57r earned 300 total points
ID: 10733366
Hello drozdzowski,

This code will create double underlines which are as wide as the control.

It comes from an Access MVP called Duane Hookom.
.........................................
Create a function in a standard module:

Function MakeLines(rpt As Report)
    Dim ctl As Control
    Dim dblSpacing As Double 'space between double underline
    dblSpacing = 30
    For Each ctl In rpt.Controls
        If ctl.Tag = "bl" Then
            rpt.Line (ctl.Left, ctl.Top + ctl.Height)-Step(ctl.Width, 0)
        End If
        If ctl.Tag = "tl" Then
            rpt.Line (ctl.Left, ctl.Top)-Step(ctl.Width, 0)
        End If
        If ctl.Tag = "dbl" Then
            rpt.Line (ctl.Left, ctl.Top + ctl.Height)-Step(ctl.Width, 0)
            rpt.Line (ctl.Left, ctl.Top + ctl.Height +
dblSpacing)-Step(ctl.Width, 0)
        End If
    Next
End Function

Edit the tag property of the controls you want to mark. Use bl for bottom
line, tl for top line, and dbl for double bottom line. Then add this code to
the section containing the controls.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Call MakeLines(Me)
End Sub
...................................................



Pete
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:drozdzowski
ID: 10733398
how do i make the size of the control (in this case textbox) change (width only) depending on the size of the number/string to be displayed?
0
 
LVL 54

Assisted Solution

by:nico5038
nico5038 earned 200 total points
ID: 10733410
The "easy" way is to use a non-proportional font like CcourierNew and use: len([fieldname]) to get the number of characters.
Now the line length can be set by multiplying that number with a constant value corresponding to the font width selected.

Using a proportional fonttype would require to count the number of different sized characters :-(

Idea ?

Nic;o)
0
 

Author Comment

by:drozdzowski
ID: 10733489
Thank you both.  I'll play with these suggestions now.

Mirek
0
 
LVL 54

Expert Comment

by:nico5038
ID: 10733581
I'm afraid that the control width won't help as it will always be the same width, not taking the filled part in account....

Nic;o)
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now