473,385 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Prevent save but allow edit?

1,271 Expert 1GB
How do you prevent a save from being done on a form but still allow editing of the form? I have a form that I use to collect information and then I save various pieces of it here and there in the code-behind on a button-click for 'Save'. But if the user navigates to another record there is an auto-save that happens and I don't want that.

If I cancel the save in the form's before update event it prevents the navigation from completing.

Thanks,

Jim
Dec 29 '14 #1
2 1071
twinnyfo
3,653 Expert Mod 2GB
Jim,

One way to check to see if a record has been changed is the
Expand|Select|Wrap|Line Numbers
  1. Me.Dirty
property. Prior to allowing the navigation to a new record, check to see if the record has been changed. If so, prevent the save, cancel the changes and then move.

One possible way of doing this with your form may be to have a constant filter on the form, such that when one "navigates" to a record, you are merely identifying the record, and then filtering the form for that record (also, make sure that AllowAdditions is set to No). Then, the user is prevented from navigating to the next record (or an new record). when they want to navigate to another record, they click the "Next" button: You check for changes, cancel any of those, identify the next record, filter by it.

Not the simplest method, but I've used similar constructions in the past--there might be easier ways to do this, too....
Dec 29 '14 #2
jimatqsi
1,271 Expert 1GB
Thanks, twinnyfo. Can't implement the filtering you suggest because of application demands; the recordset and count of records within are themselves valuable objects to the user, key to this particular app. I could clear the dirty flag and manually do the navigation ... hmmm, no, maybe not, not unless I remove the form's built-in navigation buttons and add my own.

Thanks for the ideas. I'll add them to the mix while I ponder this.
Dec 29 '14 #3

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

Similar topics

2
by: Will | last post by:
I have a form which has a field Start Date. I want to only let the user enter a date if there is no date in the field and never be able to edit the field. I have experimented with On Enter and On...
0
by: Paweł | last post by:
Hi! Within my class (say class A) I have read-only property returning reference to object of type B (since I do not want other to assign another reference to this property). I have created a ...
2
by: Peter Proost | last post by:
Hi group I'm making my own datagrid control, so for I've got a lot of things working, combobox columns, checkbox columns, blobfield columns. But now I would like to be able the disable certain...
14
by: Ed Jay | last post by:
On a multi-textbox form, linked to an external js, I use onBlur to call: function chkNum(cellname) { var str = document.getElementById(cellname).value.toString(10); if (str < 28 || str > 36)...
3
by: Neil Steventon | last post by:
Hi, Im after some advise on how to go about this problem. I have a master page with nice header and side bar setup. I then have various aspx pages that use this master page. I want one of the...
1
by: fariba123 | last post by:
hi i am working with php. i am designing a site which will store employee information along with his/her photo and also edit information. i have completed the information save and edit part. now i...
1
by: fariba123 | last post by:
hi, can i ask for a very simple example php code on how to save a photo from a form to the database or something like that? and how to get it and display it in the page? i just want a very simple...
1
by: gurmet | last post by:
Hi All I have been looking around for help, and finally post this problem. I created a form to edit a record. Before i can click save button on the edit form i need to check if the data that...
0
by: Quizzed | last post by:
Hi, Using Impromptu v7.0.702.9 I have connected to database no issues, ran the report no issues. With the report on screen I then select File | Save As, edit the file name and select the...
0
newbiefyke
by: newbiefyke | last post by:
Public Class Form3 Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load lv1.Columns.Add("name", CInt(lv1.Width / 3)) ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.