Rabu, 21 Mei 2014

RE: [MS_AccessPros] Re: Hover Color in Command Button changes in MS2013 when form is imported

 

Hi Norbert


Your code looks right to me. Did you try creating a new form to see what the HoverColor was?

-Bill


---In MS_Access_Professionals@yahoogroups.com, <drnorbert@msn.com> wrote :

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: wrmosca@comcast.net
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (13)

.

__,_._,___

Tidak ada komentar:

Posting Komentar