[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

double underline

Posted on 2004-04-01
8
Medium Priority
?
1,292 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 77

Accepted Solution

by:
peter57r earned 1200 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 800 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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

834 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