Conditional form editing?????

lorenambrose

Active Member
Joined
Sep 17, 2008
Messages
265
I have a form with a field (or control) that shows a Status. I need a way to lock out users from editing a record unless the "Status" field shows a "Rejected" entry.


"Rejected" or blank = editable

Anything else = locked


Your help would be greatly appreciated.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p> </o:p>
<o:p> </o:p>
Put this code into your forms code section and replace the ‘Status’ control with the name of your control.<o:p></o:p>

Code:
Private Sub Form_Current()
Dim blnEditable As Boolean
Select Case Nz(Me.[B][COLOR=red]Status[/COLOR][/B].Value, vbNullString)
    Case "Rejected"
        blnEditable = True
    Case vbNullString
        blnEditable = True
    Case Else
        blnEditable = False
End Select
Me.AllowEdits = blnEditable

End Sub
 
Upvote 0
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
<o:p></o:p>
Put this code into your forms code section and replace the ‘Status’ control with the name of your control.<o:p></o:p>

Code:
Private Sub Form_Current()
Dim blnEditable As Boolean
Select Case Nz(Me.[B][COLOR=red]Status[/COLOR][/B].Value, vbNullString)
    Case "Rejected"
        blnEditable = True
    Case vbNullString
        blnEditable = True
    Case Else
        blnEditable = False
End Select
Me.AllowEdits = blnEditable
 
End Sub


Awsome. Worked great. Thanks
 
Upvote 0

Forum statistics

Threads
1,224,505
Messages
6,179,153
Members
452,891
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top