Hi Bill,
Sorry for the delay,
Yes I am opening the form in design view and loop for each control and of course select acCommandButton only and also have an If condition to just change the color if found only #FFFFFF.
here is the code:
'---------------------------------------------------------------------------------------
' Procedure : ChangeHoverColorAllForms1
' Author : norbert
' Date : 5/19/2014
' Purpose :
'---------------------------------------------------------------------------------------
'
Public Sub ChangeHooverColorAllForms()
On Error GoTo ChangeHoverColorAllForms_Error
Dim DbF As Form
Dim DbO As Object
Dim Frms As Variant
Dim Frms1 As Variant
Dim ctl As Control
Set DbO = Application.Forms 'Collection of all the open forms
For Each DbF In DbO 'Loop all the forms
DoCmd.OpenForm DbF.Name, acDesign
For Each ctl In DbF.Controls
If ctl.ControlType = acCommandButton Then
'MsgBox ctl.Name
If ctl.HoverColor = 16777215 Then
ctl.HoverColor = RGB(0, 0, 255)
End If
End If
Next ctl
DoCmd.Close acForm, DbF.Name, acSaveYes
Next DbF
On Error GoTo 0
Exit Sub
ChangeHoverColorAllForms_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure ChangeHoverColorAllForms of Module ModTools"
End Sub
Please let me know of any other suggestions.
Thanks a lot
Norbert
Posted by: drnorbert@msn.com
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (12) |
Tidak ada komentar:
Posting Komentar