AllowEdits=False issue

M

Maver1ck666

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?
 
M

Maver1ck666

Thanks for the reply.

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

BeWyched said:
Hi

This give you the answer/solution:

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

Cheers.

BW

Maver1ck666 said:
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?
 
J

John Spencer

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.


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Call module/procedure 2
multiple criteria in dlookup 6
Help with allowedits 3
MAYDAY! MADAY! - Run time error 7
AllowEdits & Enable 5
Me.AllowEdits = False 4
Cannot edit subform 3
User power 1

Top