Results 1 to 5 of 5
  1. #1
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141

    Vertical Line grows when when fields grow

    I have followed the below code i found in the net for the vertical lines, this code is for Access 2013

    Private Sub detail_Print(Cancel As Integer, Printcount As Integer)
    Dim Ctldetail As Control
    Dim intLinemargin As Integer


    intLinemargin = 0


    For Each Ctldetail In Me.Section(acDetail).Controls
    With DtlDetail
    If Ctldetail.Name = "Line123" Then
    Me.Line ((.Left + .Width + .intLinemargin), 0)-(.Left + .Width + intLinemargin, Me.Height)


    End If
    End With
    Next


    Set Ctldetail = Nothing
    End Sub

    I change only the name of the line, can this be used for Access 2010, when I used the same a gap on the line is showing.

    Can you help me please.

    thank you.

    Trident

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    don't see why not, the functionality has been around since 2003 - suspect you haven't changed all the control names - these are referring to different controls

    With DtlDetail
    If Ctldetail.Name = "Line123" Then
    Me.Line ((.Left + .Width + .intLinemargin), 0)-(.Left + .Width + intLinemargin, Me.Height)

    and if you are only referencing one line, then you do not need the loop, just refer to the control directly

  3. #3
    trident is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Apr 2014
    Posts
    141
    Thank you for the reply, just need to clear some things on read

    DtlDetail - should this be a form name or will stay as is?
    Ctldetail.Name - the .Name should be change to my form name?
    Me.Line - the .Line should change to my line name?

    Trident

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    I think they should all be ctlDetail but suggest you post your original unaltered code or a link to where you got it from - at the moment, although I understand the principle of what you are trying to do, the code you are using seems unnecessarily complex and perhaps is intended to do something more. Also, please use the code tags (the # button) around the posted code to preserve indenting - although not long, your unindented code is difficult to read and I don't have the time to spend trying to figure it out

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    also to be clear, the line function is only available for reports - you are referring to forms - in which case abandon now.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Vertical line not connecting
    By trident in forum Reports
    Replies: 1
    Last Post: 04-13-2016, 06:32 PM
  2. Auto shrink/grow fields
    By Thompyt in forum Forms
    Replies: 10
    Last Post: 10-26-2014, 04:35 PM
  3. Replies: 1
    Last Post: 09-25-2013, 10:33 PM
  4. Replies: 6
    Last Post: 08-05-2013, 06:09 PM
  5. growing all fields when one field grows??
    By mooseisloose in forum Forms
    Replies: 0
    Last Post: 03-23-2011, 09:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums