i have a numeric field in a form where i enter numbers someone keeps
deleting numbers in certain fields i want to use the enabled property so
that when a number is entered and then you tab to the next field it greys it
out and you cant change it anymore. i can do it with a text field like this
me. Me.fieldname.Enabled = Len(Me.fieldname & "") = 0 how can i do it
with my numeric fields ? im sure its simple im having a brain fade
Klatuu - 13 Mar 2006 18:40 GMT
Me.FieldName.Enabled = IsNull(Me.FieldName)
Works regardless of data type.
> i have a numeric field in a form where i enter numbers someone keeps
> deleting numbers in certain fields i want to use the enabled property so
[quoted text clipped - 3 lines]
> me. Me.fieldname.Enabled = Len(Me.fieldname & "") = 0 how can i do it
> with my numeric fields ? im sure its simple im having a brain fade
dlb1228 - 13 Mar 2006 18:49 GMT
it locks the field right away i need to enter data into it and then when i
tab off it will lock
> Me.FieldName.Enabled = IsNull(Me.FieldName)
> Works regardless of data type.
[quoted text clipped - 6 lines]
> > me. Me.fieldname.Enabled = Len(Me.fieldname & "") = 0 how can i do it
> > with my numeric fields ? im sure its simple im having a brain fade
Marshall Barton - 13 Mar 2006 19:02 GMT
>i have a numeric field in a form where i enter numbers someone keeps
>deleting numbers in certain fields i want to use the enabled property so
[quoted text clipped - 3 lines]
>me. Me.fieldname.Enabled = Len(Me.fieldname & "") = 0 how can i do it
>with my numeric fields ? im sure its simple im having a brain fade
Me.fieldname.Enabled = IsNull(Me.fieldname)

Signature
Marsh
MVP [MS Access]
John Vinson - 13 Mar 2006 22:32 GMT
>i have a numeric field in a form where i enter numbers someone keeps
>deleting numbers in certain fields i want to use the enabled property so
[quoted text clipped - 3 lines]
>me. Me.fieldname.Enabled = Len(Me.fieldname & "") = 0 how can i do it
>with my numeric fields ? im sure its simple im having a brain fade
I'm confused. And I'm concerned for your users.
Are you saying that they must get ONE CHANCE ONLY, ever? and that if
they make a mistake, tab off the field, and realize that they made a
mistake, that they are to be prohibited from correcting that mistake,
ever?
I suspect there must be a better way to solve your business problem;
it might be better user training, or validating the data in the Form's
Beforeupdate event, or *something*, but locking a field the instant
you leave it seems really draconian!
John W. Vinson[MVP]