473,752 Members | 11,124 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 "frmworkord er" 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 4411
puppydogbuddy
1,923 Recognized Expert Top Contributor
I use check box in a form "frmworkord er" 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
2045
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 cluttered and more organised than throwing all the functionality in one fred.php.
25
10414
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 only the first record and then overwriting that record with the next, etc until it runs out of ID's...
4
9409
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
6784
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 not. The first field for each store table is the date and I've set that as the primary key as one...
6
4932
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 turn the Save button. I would rather the user click the "New" button to add a record instead of...
9
7750
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 but here is my code. The form has a navigation list which the user can select a record to view. An...
8
1983
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 need a way of clicking on the edit button ,bringing up a form with the record, editng the fields, and...
1
2166
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 Category that a product belongs to, but all I get in the drop-down menu is the one specific Category. ...
1
3329
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
9031
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8867
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9624
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9383
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
6836
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6116
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4738
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2243
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.