[AccessD] Changing Forecolor Of Multiple Command Buttons

Gustav Brock Gustav at cactus.dk
Thu May 5 08:41:08 CDT 2005


Hi Paul

You need another syntax:

  For intButton = 1 to 20
     Me("cmd" & intButton & "").ForeColor = 16711680
  Next intButton

/gustav

>>> paul.hartland at fsmail.net 05/05 12:11 pm >>>
To all,

I have a form which has around 20 buttons on display, based on various
bits of data the forecolor of the buttons will change.  What I want is a
function to change all the buttons forecolor to the same, I thought I
might be able to do something like below but obviously I'm being
stupid....Anyone know how I can do this using a loop....

Dim intButton as Integer
For intButton = 1 to 20
     Me.cmd & intButton.ForeColor = 16711680
Next intButton

Looking at it now I can see it wouldn't work, anyone got a solution to
this using a loop ?

Thanks in advance for all your help on this.....

Paul Hartland




More information about the AccessD mailing list