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 / July 2007

Tip: Looking for answers? Try searching our database.

where to put "allowedits = false"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ray - 10 Jul 2007 02:42 GMT
I have a form in which  I want to set 'allowedits = false' if the record is
over 1 day old. I also have a hidden control that management can press to set
'allow edits = true'.

Which is the best of the form's events to use so that if the record is over
1 day old the 'allowedits = false' will be done. I want it to function only
when it moves to another record. If I use "on Current" event, the it will set
'allowedits = false' as soon as I press the hidden control to set 'allowedits
= true'.

I have the code. I just need to know in which of the form's events to put it.
Ken Snell (MVP) - 10 Jul 2007 03:13 GMT
The form's Current event is the right event. What you need to do is revise
how you make the "management" option work. Put a hidden textbox on the form
(name it txtManagement). Have the form's Load event procedure set the value
of this textbox to 0 (which is the value for False constant). Then code the
"management" hidden control to change the value of this textbox to -1 (which
is the value for the True constant). Then in the form's Current event, use
this code:

Me.AllowEdits = Me.txtManagement.Value

Signature

       Ken Snell
<MS ACCESS MVP>

>I have a form in which  I want to set 'allowedits = false' if the record is
> over 1 day old. I also have a hidden control that management can press to
[quoted text clipped - 13 lines]
> I have the code. I just need to know in which of the form's events to put
> it.
Ray - 10 Jul 2007 03:32 GMT
Does the Load event refer to whenever the form moves to a different record?
If so can I  use something like

Iff (Now() - me.timestamp > 1.0, me.txtmanagement = -1, me.txtmanagement = 0)

 in the form's Load event?

> The form's Current event is the right event. What you need to do is revise
> how you make the "management" option work. Put a hidden textbox on the form
[quoted text clipped - 23 lines]
> > I have the code. I just need to know in which of the form's events to put
> > it.
Ray - 10 Jul 2007 04:30 GMT
I got it. Thanks. Put the IIf in the oncurrent. That will not allow edits it
at the change of records and the control can allow edits until it moves to
another record.

> Does the Load event refer to whenever the form moves to a different record?
> If so can I  use something like
[quoted text clipped - 30 lines]
> > > I have the code. I just need to know in which of the form's events to put
> > > it.
 
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



©2009 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.