Solved

double underline

Posted on 2004-04-01
8
1,246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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
 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
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 …
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…

689 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