Results 1 to 2 of 2
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Object Control doesn't contain border color

    I am making a function with border color auto changes:



    Code:
    'makes fields red that need to be completed
    Public Function tagMustComplete(TagName As String, FormImport As Form, DefaultBorderColour As Long) As String
    
    
    Dim ctl As Control
    
    
    
    
    For Each ctl In FormImport.Controls
        Select Case ctl.ControlType
        Case acComboBox, acTextBox
            If ctl.Tag = TagName Then
                If IsNull(ctl) = True Then
                .BorderColor = 2366701
                Else
                .BorderColor = DefaultBorderColour
                End If
            End If
        End Select
    Next ctl
    
    
    End Function
    however control doesn't have the property .bordercolor and I need to change the borders for the accombo boxes and actextboxes - how do I refer to them to change the property?

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    sorry added ctl.bordercolor and fixed fault

    Code:
    'makes fields red that need to be completed
    Public Function tagMustComplete(TagName As String, FormImport As Form, DefaultBorderColour As Long) As String
    
    
    Dim ctl As Control
    
    
    
    
    For Each ctl In FormImport.Controls
        Select Case ctl.ControlType
        Case acComboBox, acTextBox
            If ctl.Tag = TagName Then
                If IsNull(ctl) = True Then
                ctl.BorderColor = 2366701
                Else
                ctl.BorderColor = DefaultBorderColour            End If
            End If
        End Select
    Next ctl
    
    
    End Function

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 07-02-2013, 08:41 AM
  2. Tab control has a weird border
    By Drak in forum Forms
    Replies: 8
    Last Post: 02-05-2012, 06:28 PM
  3. Replies: 3
    Last Post: 11-02-2010, 10:14 AM
  4. Replies: 1
    Last Post: 08-05-2010, 12:11 PM
  5. Replies: 0
    Last Post: 11-13-2009, 10:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums