"kev" <ke******@gmail.comwrote in message
news:11*********************@79g2000cws.googlegrou ps.com...
Hi Keith,
I did make the Required property set to Yes.
However, the warning message displayed is not so user friendly as it
says "Microsoft acess requires this field..."
I would like it to be a statement that could be understood by all
level. eg 'Please enter a name".
Secondly,
The method you suggested only works at the end of the form when you are
about to save it, then only does the message appear.
What i want is when user move from one field to another without any
inputs i want the warning msg to appear. sort of like there is a
message for each field.
In that case what you could use is a public function to which you can pass
the control name, and call the function from the control's "lost focus"
event. This is untested air code:
Public Function libInputData(strControlName As String)
Dim strLegend As String
strLegend = "Please enter some data in the "
If strControlName = "txtMyTextBox" Then
strLegend = strLegend & "field name"
ElseIf strControlName = "whatever" Then ' ... and so on for all of your
controls.
Else
'Do something else if required
End If
strLegend =strLegend & " field."
MsgBox strLegend
End Function
You'd then call the function from a control's lost focus event supplying the
name argument:
Call libInputData(Me.txtMyTextBox.Name)
This is a quick and dirty solution to get you started but you could get a
bit smarter in slow time by looping through your controls instead if using
If ... Then.
HTH - Keith.