我这样写的代码,却会报错,请前辈帮忙看一下:
Option Compare Database
Option Explicit
Dim strsql As String
Dim rst As DAO.Recordset
Dim strFP As String
Private Sub 主体_Print(Cancel As Integer, PrintCount As Integer)
If Not IsNull([发票号码]) Then
strsql = "select 表1.[发票号码] from 表1 group by 表1.[发票号码];"
rst = CurrentDb.Recordset(strsql)
rst.AddNew
rst![发票号码] = strFP
strFP = strFP & [发票号码] & "、"
rst.Update
rst.Clone
End If
End Sub
Private Sub 组页脚0_Print(Cancel As Integer, PrintCount As Integer)
If strFP <> "" Then
Me.Text13 = Left(strFP, Len(strFP) - 1)
End If
End Sub
Private Sub 组页眉0_Print(Cancel As Integer, PrintCount As Integer)
strFP = ""
End Sub