Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / November 2005

Tip: Looking for answers? Try searching our database.

locking date()

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gerald - 28 Nov 2005 09:27 GMT
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
Marshall Barton - 28 Nov 2005 14:29 GMT
>how can I lock date field with date(), though it auto. generates current
>date, still user can change it
[quoted text clipped - 3 lines]
>
>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.

Signature

Marsh
MVP [MS Access]

Gerald - 29 Nov 2005 04:48 GMT
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

> >how can I lock date field with date(), though it auto. generates current
> >date, still user can change it
[quoted text clipped - 14 lines]
> so there is no reason for the bound text box on the form to
> be unlocked.
Marshall Barton - 29 Nov 2005 13:39 GMT
Did you try trmoving that line of code and setting the text
box's Locked property in design view?
Signature

Marsh
MVP [MS Access]

>it gives me the error as below
>run-time error 2166
[quoted text clipped - 21 lines]
>> so there is no reason for the bound text box on the form to
>> be unlocked.
Gerald - 30 Nov 2005 04:04 GMT
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

> Did you try trmoving that line of code and setting the text
> box's Locked property in design view?
[quoted text clipped - 23 lines]
> >> so there is no reason for the bound text box on the form to
> >> be unlocked.
Marshall Barton - 30 Nov 2005 06:11 GMT
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.
Signature

Marsh
MVP [MS Access]

>well, no.
>
[quoted text clipped - 34 lines]
>> >> so there is no reason for the bound text box on the form to
>> >> be unlocked.
Gerald - 30 Nov 2005 05:52 GMT
thanks, Marshall problem resolved..

appreciate it.

> Did you try trmoving that line of code and setting the text
> box's Locked property in design view?
[quoted text clipped - 23 lines]
> >> so there is no reason for the bound text box on the form to
> >> be unlocked.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.