rikklaney1
Registered User.
- Local time
- Today, 14:24
- Joined
- Nov 20, 2014
- Messages
- 157
I am trying to set the backcolor of a control based on whether or not that control shows in a list but I am getting stuck. I get a cannot find field error when I run it. Any idea what I've got wrong?
For x = 0 To 30
'If Me.List61.Column(4, x) = "AM060" Then Me.AM060.BackColor = 255
If Not IsNull(Me.List61.Column(4, x)) Then me.[& list61.Column(4,x) &].BackColor = 255
Next
The second line works so I'm trying to make the third line do the same for the whole form without adding that line of code for each control.
For x = 0 To 30
'If Me.List61.Column(4, x) = "AM060" Then Me.AM060.BackColor = 255
If Not IsNull(Me.List61.Column(4, x)) Then me.[& list61.Column(4,x) &].BackColor = 255
Next
The second line works so I'm trying to make the third line do the same for the whole form without adding that line of code for each control.