Solved

double underline

Posted on 2004-04-01
8
1,194 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

911 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

17 Experts available now in Live!

Get 1:1 Help Now