R
Robert
I need a field in the properties to store a descriptive name of a textbox's
contents.
If a required field, which has "R" in the Tag field in the properties, has
not been entered a message box appears:
MsgBox "Please enter a value for " & ctl.Name
Where ctl.Name is the name of the text box. l need to be able to say, for
example, "Department Number" instead of "txtDeptno". I could put
"Department Number" after the "R" in the tag and parse up tag but is there
another field? How about ControlTip Text or Validation Text? (I can't find
a simple definition of these fields in the Help. (Indeed, I was wondering
what a Validation Rule is anyway, but how do you look that up with that
help?).
Is there any way to reference the label field attached to the textbox?
I am using Access 2002.
This is the complete code if you're interested:
For Each ctl In Me.Controls
If ctl.Tag = "R" Then
If LenB(Nz(ctl, vbNullString)) = 0 Then
MsgBox "Please enter a value for " & ctl.Name
Cancel = True
ctl.SetFocus
Exit Sub
End If
End If
Next ct
contents.
If a required field, which has "R" in the Tag field in the properties, has
not been entered a message box appears:
MsgBox "Please enter a value for " & ctl.Name
Where ctl.Name is the name of the text box. l need to be able to say, for
example, "Department Number" instead of "txtDeptno". I could put
"Department Number" after the "R" in the tag and parse up tag but is there
another field? How about ControlTip Text or Validation Text? (I can't find
a simple definition of these fields in the Help. (Indeed, I was wondering
what a Validation Rule is anyway, but how do you look that up with that
help?).
Is there any way to reference the label field attached to the textbox?
I am using Access 2002.
This is the complete code if you're interested:
For Each ctl In Me.Controls
If ctl.Tag = "R" Then
If LenB(Nz(ctl, vbNullString)) = 0 Then
MsgBox "Please enter a value for " & ctl.Name
Cancel = True
ctl.SetFocus
Exit Sub
End If
End If
Next ct