I'm relatively new to Access so not sure what's going wrong. I'm trying to use VBA to create group levels to group a report called Patient List by Location and I would like a Header to be created with that.
I've tried this:
Sub tcitable()
Dim varGL As Variant
DoCmd.OpenReport "Patient List", acViewDesign
varGL = CreateGroupLevel("Patient List", "Location", True, False)
Reports![Patient List].Section(acGroup1Header).Height = 400
DoCmd.OpenReport "Patient List", acViewNormal
End Sub
However, when I try to run this, it creates the group level (I can see it in the Group & Sort bit) but says Run time error 29054 - Microsoft Access can't add, rename or delete the controls; and no header shows up.
Anyone able to help?
question from:
https://stackoverflow.com/questions/65896311/create-group-levels-not-creating-headers-or-footers-in-access-vba 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…