locking date()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how can I lock date field with date(), though it auto. generates current
date, still user can change it

used below
Me!dateenter.Locked = Not IsNull(Me!dateenter)

gives me error

plz advise
thanks
 
Gerald said:
how can I lock date field with date(), though it auto. generates current
date, still user can change it

used below
Me!dateenter.Locked = Not IsNull(Me!dateenter)

gives me error


Which error?
Where is that line?
I think that line should be ok, if it is placed in the
Form's Current event procedure.

BUT, why not just set the text box's Locked property in
design view? As Allen said in your other thread, the date
value would be set by using the table field's DefaultValue,
so there is no reason for the bound text box on the form to
be unlocked.
 
it gives me the error as below
run-time error 2166
You can't lock a control while it has unsaved changes

when - while trying the change the date from dateenter which has Date() in
table design date enter field

purpose is I don't want users to alter the dateenter field

thanks
 
Did you try trmoving that line of code and setting the text
box's Locked property in design view?
 
well, no.

in table design I have a date field with Datefunction
and in form design under the control source of Date field I have this below
code
Me!dateenter.Locked = Not IsNull(Me!dateenter)

date does auto. generates, but only gives me the below error while trying to
change the date

thanks


Marshall Barton said:
Did you try trmoving that line of code and setting the text
box's Locked property in design view?
--
Marsh
MVP [MS Access]

it gives me the error as below
run-time error 2166
You can't lock a control while it has unsaved changes

when - while trying the change the date from dateenter which has Date() in
table design date enter field
 
thanks, Marshall problem resolved..

appreciate it.

Marshall Barton said:
Did you try trmoving that line of code and setting the text
box's Locked property in design view?
--
Marsh
MVP [MS Access]

it gives me the error as below
run-time error 2166
You can't lock a control while it has unsaved changes

when - while trying the change the date from dateenter which has Date() in
table design date enter field
 
That would make no sense in the control source. If you
really need to use that line of code, then it would go in
the Form's Current event procedure.
 
Back
Top