Dynamische Variablennamen (Berichterstellung per VBA) nstr = DMax("[Strang]", "Pr_Verteiler") 'StrangDim (rechts) h = 0.476 * tw: b = 0.788 * tw: x = (xsdim + strangabstand * (sn - 1)) * tw: Y = 0.799 * tw Set ctl = CreateReportControl("b_Pr_Strangschema", acTextBox, acDetail, "", "", x, Y, b, h) ctl.Name = "strdim" & sn ctl.ControlSource = "=iif([mstr" & sn & "]>0,rohrdimension([mstr" & sn & "]))" ctl.BorderStyle = 0 ctl.TextAlign = 2 'Anzahl Heizkreise rechts h = 0.317 * tw: b = 0.75 * tw: x = (xvhkR + strangabstand * (sn - 1)) * tw: Y = 0.698 * tw Set ctl = CreateReportControl("b_Pr_Strangschema", acTextBox, acDetail, "", "", x, Y, b, h) ctl.Name = "hk" & sn & "_R" strs = sn & ".2" If sn < 10 Then strs = "0" & strs ctl.ControlSource = "=""HK:"" & DLookup(""[Heizkreise]"", ""Pr_Verteiler"", ""[GeschossNr] = [Feld0] and [StrangSeite] = '" & strs & "' and [sb] = '"" & sb & ""'"")" ctl.BorderStyle = 0 ctl.TextAlign = 2 ctl.FontSize = 7 Dim i As Integer For i = 1 To nstr If Me("Verteiler" & (i) & "_L") = 0 Then Me("Verteiler" & (i) & "_L").Visible = False Me("lhv" & (i) & "_L").Visible = False Me("lhr" & (i) & "_L").Visible = False Me("Vdim" & (i) & "_L").Visible = False Me("hk" & (i) & "_L").Visible = False End If If Me("Verteiler" & (i) & "_R") = 0 Then Me("Verteiler" & (i) & "_R").Visible = False Me("lhv" & (i) & "_R").Visible = False Me("lhr" & (i) & "_R").Visible = False Me("Vdim" & (i) & "_R").Visible = False Me("hk" & (i) & "_R").Visible = False End If Next i