Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drawning or Coding Verticle lines in report 3

Status
Not open for further replies.

psbsmms

Programmer
Dec 14, 2001
74
I am trying to draw vertical lines between textboxes that flow between sections of a report and are connected throughout the detail section. I thought i saw how to do this, but have either lost the link or lost my mind. is this possible in Access, I have done it in crystal very easily, but can't seem to find the right way to do it in the access report. I am trying to9 create a report that looks like invoices and PO's.
 
I generally base the horizontal location of my vertical lines according to the beginning and ending of their column headings. That is, the column heading is the size of the column. The reason for this is so that if I move my columns around, I don't have to change my code.

For example, suppose my column headings look like this:

+-------+----------------+-------+--------+
| Name | Address | City | State |
+-------+----------------+-------+--------+

I would name the column headings something like:
lblName
lblAddress
lblCity
lblState

Now, assume that Address is the only control that can grow vertically. The code would then look something like this:

Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

'********************************
'*  Declaration Specifications  *
'********************************

    Dim sngHt As Single

'*************************
'*  Draw Height of line  *
'*************************
    
    On Error GoTo ErrHandler
    
    sngHt = txtAddressControl.Height
    sngHt = sngHt + (0.0416 * 1440)
        
'*************************
'*  Draw vertical lines  *
'*************************

    Me.Line (lblName.Left, 0)-(lblName.Left, sngHt)
    
    Me.Line (lblAddress.Left, 0)-(lblAddress.Left, sngHt)
    Me.Line (lblCity.Left, 0)-(lblCity.Left, sngHt)
    Me.Line (lblState.Left, 0)-(lblState.Left, sngHt)
    Me.Line (lblState.Left + lblState.Width, 0)-(lblState.Left + lblState.Width, sngHt)

'********************
'*  Exit Procedure  *
'********************
    
ExitProcedure:

    Exit Sub

'****************************
'*  Error Recovery Section  *
'****************************
        
ErrHandler:
        
    MsgBox Err.Description, vbExclamation
        
    Resume ExitProcedure
    
End Sub
 
Thanks, I think this will do what i want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top