我试图遍历报告记录集(行),并将控件的标题与字段中的值进行比较。我尝试过的一切都没有用。
代码
Private Sub Report_Load()
Dim rstForm As DAO.Recordset
Dim fldName As String
Set rstForm = Forms!ChangedData.Form.Recordset
Do While Not rstForm.EOF
If (Me.lblCompetitive.Caption = FieldModified.value) Then
Me.Competitive.BackColor = vbYellow
End If
rstForm.MoveNext
Loop
End Sub