473,473 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Question about Overwrite prompt window

1 New Member
Hello,
I'm coding a program that saves information about my patients, so i created a rich textbox for every field. (Name, Tel, etc). The program saves a .txt for each field, no matter if there is something on it or not.

Then I realized that if i forget to look if that patient already has his files and saved, it would automatically overwrite everything.

After searching your forums for a little bit I found the code for asking to overwrite or not, the problem is that there are 209 Textboxs, so clicking "no" could be a little bit boring if I have 500+ patients.

So i wanted to add the overwrite prompt line to only one save line, but when it asks and i click "No" it doesn't saves that file...but it overwrites the others.

Is there a way to execute a code when the user clicks "Yes" on the Overwrite Prompt Window and to execute a different code when the user clicks "No"?

I'm sorry if it was a little confusing, be free of asking something.

Thanks in advance,

Aere.
Jan 27 '07 #1
1 1451
willakawill
1,646 Top Contributor
Hi. It looks like you are using a validation routine for every field. It also seems that you don't want to do this. That you want a global validation routine. In this case you would have the validation code only in the one routine for the onclick event of the save button. You would prompt the user to save or not and skip the save routines if not.

Even though you are not using a database to save your data it still seems a little odd that you would have a text file for each field.

If you post the code associated with your form perhaps we can do something
Jan 27 '07 #2

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

Similar topics

5
by: Gord | last post by:
Hello, If you set the flag for an overwrite prompt using the 'Save' common dialog, how do you read the response when the user clicks the Yes or No in the 'overwrite' message box? Everything...
2
by: Mark English | last post by:
Is there a safe way to run tkinter in a multithreaded app where the mainloop runs in a background thread ? Here's some test code demonstrating the problem. I'm running Python2.4 under Windows...
7
by: Petesman | last post by:
I am trying to make a prompt that will ask the user for some input... If I just use var input = prompt("dafa") everything works fine but the box is put in the top left corner of the window. I need...
0
by: Zero | last post by:
how to Overwrite Existing Excel File without prompt and quit?
2
by: David Buchan | last post by:
I have written a program to write some text to a file. Currently, if the file already exists, the program simply overwrites it. What I'd like to do, is have the program ask me if I wish to...
5
by: Jean-Claude Garreau | last post by:
Hi, I'm a beginner with python 2.4. I use it on Win XP Pro. I have no problems with the GUI IDLE, but when I copy the instructions in a script file, say 'test.py' and double click on the file,...
2
by: hzgt9b | last post by:
I know how to overwrite a function. Normally this is what I would do: function someFunction() { /* orig definition here */ } //later in the execution stream I would do... someFunction = function...
4
by: Andy | last post by:
Hi, I'm trying to begin a new application in Wpf, and I'm trying to do some similar things to what I have been in Wpf. For example, in WinForms I have a base BusinessEditForm class. This...
8
by: Joe Duchtel | last post by:
Hello - I have the following code to detemine a file name when my application is saving a file. The problem is that if the file already exists and I select the Yes button in the "Do you want to...
0
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,...
0
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...
0
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...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
1
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...
0
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...
0
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...

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.