Each control has a Tag property that you can use however you want. Stick
whatever description you want in the Tag property, and then use
msg = "Data Required for '" & ctl.Tag & "' field!" & nl & _
"You can't save this record until this data is provided!" & nl & _
"Enter the data and try again . . . "

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
>I was looking at some code for validation.... like this....
>
[quoted text clipped - 25 lines]
>
> Thanks
>Each control has a Tag property that you can use however you want. Stick
>whatever description you want in the Tag property, and then use
>
> msg = "Data Required for '" & ctl.Tag & "' field!" & nl & _
> "You can't save this record until this data is provided!" & nl & _
That won't work......... The "Tag" is being used to identify which fields to
check.....
"If ctl.Tag = "*" And Trim(ctl & "") = "" Then"
So....... It would work if you changed the tag on every field and had
multiple IF...Then statements.
But..... Not what I want to do.......
Thats what has been frustrating trying to get an answer on this one! OR
simply why it wont work. The "caption" can be set in the table. THAT is what
I am really trying to reference.
Douglas J. Steele - 03 May 2007 18:52 GMT
>>Each control has a Tag property that you can use however you want. Stick
>>whatever description you want in the Tag property, and then use
[quoted text clipped - 13 lines]
> what
> I am really trying to reference.
While it's a pain, you can store multiple pieces of information in the Tag
property.
Put, say, a semicolon after the asterisk, followed by the caption you wish
to use:
*;Caption
You'd then use:
If Left(ctl.Tag, 1) = "*" And Trim(ctl & "") = "" Then
and
msg = "Data Required for '" & Mid(ctl.Tag, 3) & "' field!" & nl & _
"You can't save this record until this data is provided!" & nl & _
Heck, you don't even really need the semicolon in this case: just put an
asterisk in front of the caption (and use Mid(ctl.Tag, 2) in the assignment
statement instead)

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
marius - 03 May 2007 19:25 GMT
> ... The "caption" can be set in the table. THAT is what
> I am really trying to reference.
You can try something like:
msg= ...... & Me.Recordset.Fields(ctr.ControlSource).Properties("Caption")
& ....
(if property isn't set you get an error, trap it)

Signature
HTH,
Màrius - BCN