I have a form "form1 with an unbound text box: "pos2". I also have a number of rectangles(a1, a2, a3 etc.). I also have a command button "Command59".
I would like to enter the name of a rectangle in field "pos2" and when command59 is clicked, change the back color of the rectangle that was entered in field "pos2".
Here is what I have tried. I entered the name of rectangle a1 in field "pos2" and clicked on the button using the following code:
Private Sub Command59_Click()
Forms!form1![pos2].BackColor = "16744448"
End Sub
The problem is that clicking on the button only changes the backcolor of field "pos2" and not rectangle "a1".
I have been reading "VBA for dummies" but it has not helped me much...
Would appreciate any help!
Kind regards,
Hanss
Zurich, Switzerland
I would like to enter the name of a rectangle in field "pos2" and when command59 is clicked, change the back color of the rectangle that was entered in field "pos2".
Here is what I have tried. I entered the name of rectangle a1 in field "pos2" and clicked on the button using the following code:
Private Sub Command59_Click()
Forms!form1![pos2].BackColor = "16744448"
End Sub
The problem is that clicking on the button only changes the backcolor of field "pos2" and not rectangle "a1".
I have been reading "VBA for dummies" but it has not helped me much...
Would appreciate any help!
Kind regards,
Hanss
Zurich, Switzerland