Please excuse my inexperience...
I have a form with 26 labels named "Bar1" to "Bar26" in the form (I'm fiddling with making a custom graph - yes I know Access has built in graph functions).
I'm trying to work out an efficient way of making these label's backcolour property toggle between two colours when clicking them.
I created code which actually did work when placed in one of the individual label's on click event (lbl changed to Me.Bar1) but when I move the code to a sub and try to refer to this sub I get:
"Run-time error '438': Object doesn't support this property or method"
I've tried many searches and tried many things but I'm stumped.
Could someone please advise? Thanks.
This is the code:
Code:Sub barColour(lbl As Label) If lbl.BackColor = RGB(214, 220, 229) Then lbl.BackColor = RGB(132, 151, 176) ElseIf lbl.BackColor = RGB(132, 151, 176) Then lbl.BackColor = RGB(214, 220, 229) End If End Sub Private Sub Bar1_Click() barColour (Me.Bar1) End Sub