By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,067 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

block edit and delete record in form

P: 59
I use check box in a form "frmworkorder" like confirmation that's record finish.
How can I write code who will block edit and delete record in form when is check box confirmed.
Feb 9 '08 #1
Share this Question
Share on Google+
4 Replies


puppydogbuddy
Expert 100+
P: 1,923
I use check box in a form "frmworkorder" like confirmation that's record finish.
How can I write code who will block edit and delete record in form when is check box confirmed.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. If Me!YourCheckbox.Value = True Then
  3.        Me.AllowEdits = False
  4.        Me.AllowDeletions = False
  5. Else
  6.        Me.AllowEdits = True
  7.        Me.AllowDeletions = True
  8. End If
Feb 9 '08 #2

P: 59
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. If Me!YourCheckbox.Value = True Then
  3.        Me.AllowEdits = False
  4.        Me.AllowDeletions = False
  5. Else
  6.        Me.AllowEdits = True
  7.        Me.AllowDeletions = True
  8. End If
I have one quick search control in form and when i put this code in form
quick searck not work. What can I do that quick search work.
Feb 11 '08 #3

Minion
Expert 100+
P: 108
Could you include more information on the quick search and what about it is not working, such as an error message or better yet the code that is causing the problems. Without further information there is not much that we can tell you.

- Minion -

I have one quick search control in form and when i put this code in form
quick searck not work. What can I do that quick search work.
Feb 11 '08 #4

puppydogbuddy
Expert 100+
P: 1,923
I have one quick search control in form and when i put this code in form
quick searck not work. What can I do that quick search work.

Ok, since you did not mention the search control exception, the code I gave you blocks edits and deletes for the entire form. You might be able to get around it by adding the following code. If this additional code does not do the trick, then we need code that loops thru each control on the form. Give this additional code a try and let us know what happens.
Expand|Select|Wrap|Line Numbers
  1. Private Sub YourSearchControl_Enter()
  2.   Me.AllowEdits = True
  3. End Sub
  4.  
  5. Private Sub YourSearchControl_Exit()
  6.      If Me.YourCheckbox.Value = True
  7.             Me.AllowEdits = False
  8.      Else 
  9.             Me.AllowEdits = True
  10.      End If
  11. End Sub
Feb 12 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.