Un-highlighting Required Fields
Thanks Thanks:  0
Likes Likes:  0
Page 4 of 4 FirstFirst ... 234
Results 31 to 33 of 33

Thread: Un-highlighting Required Fields

  1. #31
    Board Regular
    Join Date
    Jan 2013
    Posts
    257
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Un-highlighting Required Fields

    How can I update your code to accommodate for multiple values in the tag property field?

    This is what I tried to update it to, but it' snot working.

    Code:
    Private Sub Form_Current()
    Dim ctl As Access.Control
        For Each ctl In Me.Controls
            With ctl
                Select Case .ControlType
                    Case acTextBox, acComboBox, acListBox
                        If InStr(ctl.Tag, "*") = "*" And (Len(ctl & "") = 0) Then
                            .BackColor = REQUIRED_BACKCOLOR
                            .OnLostFocus = "=Highlight([" & .Name & "])"
                        Else
                            .BackColor = DEFAULT_BACKCOLOR
                        End If
                End Select
            End With
        Next
    The line in red used to be:
    Code:
    If (.Tag = "*") And (Len(ctl & "") = 0) Then

  2. #32
    MrExcel MVP
    Moderator
    xenou's Avatar
    Join Date
    Mar 2007
    Location
    Clev. OH, USA
    Posts
    15,812
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Un-highlighting Required Fields

    Instr returns a number, not the string sought:

    try:
    Code:
    If InStr(ctl.Tag, "*") > 0 And (Len(ctl & "") = 0) Then

    Using: Office 2010/Win7 (work) Office 2010/Win7 (home)

    You are rich in proportion to the number of things you can let alone.
    -- Henry David Thoreau

  3. #33
    Board Regular
    Join Date
    Jan 2013
    Posts
    257
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Un-highlighting Required Fields

    YES!!! This worked perfectly. Thank you so much.

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

DMCA.com