正确大多数线路编码需要

时间:2015-04-28 17:53:30

标签: vba ms-access access-vba ms-access-2003

由于我正在学习Access VBA,我需要编写最右边的行。这就是代码构建器在我从我需要生成的字母的工作中继承的数据库中的样子。

我所知道的是,我必须将整数从1减少到10到1到7才能使隐藏字段的网格线消失但字母缺少最右边的垂直线....我尝试了1到8整数但有错误。

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Dim lDarkGray As Long: lDarkGray = 3355443
    Dim lWidth As Long: lWidth = Me.Width
    Dim lHeight As Long: lHeight = Me.Height
'left most line
    Me.Line (0, 0)-Step(0, lHeight), lDarkGray
'the rest of the vertial lines
    Dim i As Integer
    For i = 1 To 7 Step 1
        Me.Line ((Me("txt" & i).Left + Me("txt" & i).Width), 0)-Step(0, lHeight), lDarkGray
    Next i
'bottom lines
    Me.Line (0, lHeight)-Step(lWidth, 0), lDarkGray
End Sub

1 个答案:

答案 0 :(得分:0)

尝试i = 0到7步骤1,我认为ctrls是0索引?