Will wrote:
I have a form which has a field Start Date. I want to only let the user
enter a date if there is no date in the field and never be able to edit the
field. I have experimented with On Enter and On Click and enabling and
disabling the field but can't get it to work. Any suggestions?
Use the on current event and toss in something like the following air code:
if isnull(me.txtStartDAte) = false then
me.txtstartdate.locked = true
'For a little bit of fanciness use one or both of the following:
me.txtStartDate.StatusBarText = "Record already created: You can't
change the date"
me.txtStartDate.ControlTipText = "Record already created: You can't
change the date"
ELSE
me.txtstartdate.locked = false
'For a little bit of fanciness use one or both of the following:
me.txtStartDate.StatusBarText = "Transaction/create date"
me.txtStartDate.ControlTipText = "Transaction/create date"
end if
I prefer locking instead of enable/disable, just in case someone wants
to copy the information, but that's a personal preference. I also llike
to alter the staus bar text and/or the controltip text as well to help
the user with what it is they must enter into a particular control, what
any restrictions might be, etc, though care must be taken that your
statusbar text does not get too big or smaller screen resolutions won't
see it.
--
Tim
http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me