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 / Modules / DAO / VBA / February 2008

Tip: Looking for answers? Try searching our database.

AllowEdits=False issue

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maver1ck666 - 07 Feb 2008 15:00 GMT
I have a main form which pulls down data based on the form it was open from.

What I want it to do is to look at a field it has just updated, and
depending on its result, either make AllowEdits = false or true (and a couple
of others).

I used the code:

If [Forms]![Frm UserViewBreach]![Str_Status] = "Rejected" Then
   
   Me.AllowEdits = True
   Me.AllowAdditions = True
   Me.AllowDeletions = True
   CmdSubmit.Enabled = True

   Else
   
   Me.AllowEdits = False
   Me.AllowDeletions = False
   Me.AllowAdditions = False
   CmdSubmit.Enabled = False

End If

Now it runs through the code but I can can still make changes etc on the form.

What am I missing please?
BeWyched - 07 Feb 2008 15:17 GMT
Hi

This give you the answer/solution:

http://kbalertz.com/167420/Editable-AllowEdits-Property-False.aspx

Cheers.

BW

> I have a main form which pulls down data based on the form it was open from.
>
[quoted text clipped - 23 lines]
>
> What am I missing please?
Maver1ck666 - 07 Feb 2008 15:31 GMT
Thanks for the reply.

Im not sure though how this will work and it doesn't seem applicable to A03.

> Hi
>
[quoted text clipped - 33 lines]
> >
> > What am I missing please?
John Spencer - 07 Feb 2008 19:12 GMT
Try saving the change to the record first.

If [Forms]![Frm UserViewBreach]![Str_Status] = "Rejected" Then

   Me.AllowEdits = True
   Me.AllowAdditions = True
   Me.AllowDeletions = True
   CmdSubmit.Enabled = True

   Else

   If Me.Dirty = True THEN Me.Dirty = False

   Me.AllowEdits = False
   Me.AllowDeletions = False
   Me.AllowAdditions = False
   CmdSubmit.Enabled = False

End If

I'm not sure that will do it, but I am pretty sure that if the record is
dirty the form's property can't be set so the it is not editable.

Signature

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
.

>I have a main form which pulls down data based on the form it was open
>from.
[quoted text clipped - 26 lines]
>
> What am I missing please?
 
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.