Dim frm As Form, intRC As Integer
'Dim intRC As Integer
Set frm = [Form_费用报销单明细]
With frm
intRC = .RecordsetClone.RecordCount
If intRC < 4 Then
.Form.InsideHeight = 1038 + 519 * intRC
Else
.Form.InsideHeight = 2545
End If
End With
End Sub
子窗体代码为:
Option Compare Database
Option Explicit
Dim intRC As Integer
Private Sub Form_AfterInsert()
intRC = Me.RecordsetClone.RecordCount
If intRC < 4 Then
InsideHeight = 1038 + 519 * intRC
Else
InsideHeight = 2595
End If
End Sub
Private Sub Form_Current()
intRC = Me.RecordsetClone.RecordCount
If intRC < 4 Then
InsideHeight = 1038 + 519 * intRC
Else
InsideHeight = 2595
End If