Full Version: Automatic Asterisk On Labels For Required Fields
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
darnellk
I'm assuming this has been asked before, but I can't seem to find it.

I was wondering if there's a way to reference the 'Required' property of a field in the table - and then when a form loads I could loop through the labels/captions and add an asterisk to denote that the field is required.

Thanks.
theDBguy
Hi,

Or you could consider this approach from Allen Browne's website: Highlight the required fields, or the control that has focus

Just my 2 cents... 2cents.gif
icemonster
or try the method i'm using:

CODE
Function RequiredFields()

    Dim lngBrickRed As Long <- for the color
    Dim NotFilledIn As Boolean

    lngblack= RGB(0, 0, 0)
    NotFilledIn = False
    For Each ctrl In Me
        If InStr(ctrl.Tag, "Required") Then
        
            If IsNull(ctrl) Then
                NotFilledIn = True
                ctrl.BackColor = 10092543   'Yellow
                ctrl.BorderColor = 13311    'Red
            Else
                ctrl.BackColor = 16777215   'White
                ctrl.BorderColor = lngblack 'black
            End If
            
        End If
    Next ctrl

End Function


this loops through the control though be mindful that my
icemonster
put it in your save or something.
darnellk
Thanks a lot dbGuy! I always forget to look at Allen's site, but that's one of the first places I should always be going to.

Do you know how I can convert an RGB color from the color picker to the HEX code that's used?
theDBguy
Hi,

QUOTE (darnellk @ May 31 2012, 08:14 PM) *
Do you know how I can convert an RGB color from the color picker to the HEX code that's used?

For that, check out the Code Archive. For example, this one:

CyberCow's Color Picker

Just my 2 cents... 2cents.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.