473,513 Members | 2,552 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

block edit and delete record in form

59 New Member
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
4 4381
puppydogbuddy
1,923 Recognized Expert Top Contributor
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
barkarlo
59 New Member
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
108 Recognized Expert New Member
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
1,923 Recognized Expert Top Contributor
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

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

Similar topics

10
2016
by: Jim | last post by:
Hi, Let me explain how I'd generally do things. For a page where the user edits data, I'd generally call it something like editfred.php (for example), the page which updates the data would be called updatefred.php and equally the page which processes a delete would be deletefred.php. I like splitting the pages up this way, it feels less...
25
10359
by: dixie | last post by:
I have some code that adds new records into a table for each ID in a list box when a button on a form is clicked. This works fine. My problem now is that I wish to be able to edit all the records for people whose ID is in the list box. I made minor changes to the code (mainly replacing rs.AddNew with rs.Edit)and it appears to be updating...
4
9398
by: Stephen | last post by:
Hello People, Using MS Access 2003 VBA I get the error 3020 Update or CancelUpdate without AddNew or Edit when I run through the following code. Can anyone help suggest anything to try? Thanks. On Error GoTo delete_failed Dim RS_DEL As DAO.Recordset
13
6753
by: ricky.agrawal | last post by:
I'm really not sure how to go about this in Access. What I've created is a table for each location. Those tables are identical in format but different in information. The tables are named after key points such as the store number and the store ID. The fields of those tables are generic fields such as sales per day, bank deposit and what...
6
4920
by: Ken Mylar | last post by:
I have a dilema here that I'm hoping some one can help me out with. On my forms I have some basic New, Edit, Save, Delete, Undo buttons on them. When first opened all controls on the form are not enabled. When you hit one of the buttons certain controls enable and some don't depending on the function. My dilema is with the New button and in...
9
7723
bhcob1
by: bhcob1 | last post by:
Hey guys, 'Update or CancelUpdate without AddNew or Edit' On my database i keep occasionly get this error when i try and edit a field, it is not everytime. It will be working fine and then this error appears. I will be editing records and then a random one will get the error. A bit of background on my form, this will seem a bit lengthy...
8
1973
by: =?Utf-8?B?bWlrZWc=?= | last post by:
Hi, I am building a small Help Desk application for my company and need to be able to edit "open" help desk issues. I use a simple datagrid to display each issue (6 per page) , with an Edit button. There are a lot of fields across, and my Network Admins would like a way of editing/updating each issue seperately in a a vertical form. I...
1
2152
by: ollielaroo | last post by:
Hi guys, Firstly I did do a search for this one first but I couldn't find anything related in this forum. I am using Dreamweaver MX and trying to build admin pages for an ASP site. My problem is I have Categories and various Products in each Category. I'm trying to build a page to EDIT/UPDATE each product.I want to be able to change the...
1
3302
by: chromis | last post by:
Hi, I'm having trouble fully implementing the edit section of a contact admin system, so far I have written the following: - Bean (Contact.cfc) - Data Access object (ContactDAO.cfc) - Gateway (ContactGateway.cfc) - index.cfm - Deals with the business logic - display/form.cfm - Produces the form for both add and edit behaviour
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7565
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5704
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5103
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4759
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
473
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.