no worries - eventually found some sample code hidden in the murky
depths of the help files, it works a treat.
----------------------------------------
Sub SetTextBoxProperties(frm As Form)
Dim ctl As Control
' Enumerate Controls collection.
For Each ctl In frm.Controls
' Check to see if control is text box.
If ctl.ControlType = acTextBox Then
' Set control properties.
If ctl.OldValue < 0 Then
With ctl
.SetFocus
.ForeColor = 255
End With
Else
With ctl
.ForeColor = 16711680
End With
End If
End If
Next ctl
End Sub
---------------------------------------------
Owen
--- In [email protected], "owen_group_profile"
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I've got a few forms, each with 10-30 text boxes.
>
> For the On Current() event, I want to change the colour of the text if
> the value is < 0.
>
> Is there a way I can code this to cover all the text boxes without
> having to name each one specificly?
>
> Thanks,
> Owen
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AccessVBACentral/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/