473,748 Members | 10,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disable SAVE button

69 New Member
Hi there, I have a Save REQUIRED fields button and when all required fields have been filled in, the Save REQUIRED fields button becomes enabled. I have created a DATE field so that when the button is pressed, it gives me a date and time when they pressed it.

Is there a way to disable this button once someone presses it?

Thank you for your assistance.
Jul 11 '07 #1
3 4534
JustJim
407 Recognized Expert Contributor
Hi there, I have a Save REQUIRED fields button and when all required fields have been filled in, the Save REQUIRED fields button becomes enabled. I have created a DATE field so that when the button is pressed, it gives me a date and time when they pressed it.

Is there a way to disable this button once someone presses it?

Thank you for your assistance.
Set the YourButtonName. Enabled property to false at the end of the OnClick Sub after your Save and Date code. Just off the top of my head, you'll probably have to move the focus off the button before you disable it.

You could also use the .Visible property to hide the button. They can't click what they can't see! You also have to move focus away before you can set .Visible to false.

Edit: you can use the SomeOtherContro l.SetFocus to move the focus away.

Note that you will need some method of re-enabling or re-showing the button, probably in the form's OnOpen event.

Jim
Jul 12 '07 #2
missinglinq
3,532 Recognized Expert Specialist
I think this might work a little better:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.  If Me.NewRecord Then
  3.    YourSaveButton.Enabled = True
  4.  Else
  5.    If Not IsNull(YourDateTextBox) Then
  6.     YourSaveButton.Enabled = False
  7.    Else
  8.     YourSaveButton.Enabled = True
  9.    End If
  10.   End If
  11.  End Sub
Good Luck!

Linq ;0)>
Jul 12 '07 #3
JustJim
407 Recognized Expert Contributor
Yes, that would do it nicely.
Jul 12 '07 #4

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

Similar topics

5
1698
by: Vern | last post by:
I would like to disable a button on the form if the user is not authorized to use it. I've created a custom button and would like for each button to know if it should be enabled or disabled based on another class that would contain the users authority levels. I know I can use the on form load event, but I rather test to see if the user has access to the button during the buttons OnPaint event? If they don't have access, I'd like to...
1
2718
by: Selen | last post by:
How can I disable save button in Word Documents from asp.net c#..... And I am saving Word documet to sql server database (Blob-image field)How can I undersatand when user open the document from database and change it?When user change it I save it another image field ... Thank you....
6
376
by: jack-e | last post by:
Hi, Can someone please provide me with an example of how to disable the submit button once clicked (using javascript i guess). Keep in mind I also have to invoke a server side function which processes the form. Thanks in advance. Jack
16
3457
by: Barry Gilmore | last post by:
Is there a way to disable a button after it is clicked? I am trying to avoid having someone click on it twice while they wait for it to process. Thank you!
3
4603
by: Rick Shaw | last post by:
Hi, can anyone help? I am fairly new to C# and need help with a functionlity in my app. What I need to accomplish is to be able to enable the SAVE button as soon as the user modifies a data in the form. Data could be in a datagridview or textbox. All data are connected to the tables/dataset. What is the easiest way to do this? Thank you.
6
2025
by: Stuart Quinn | last post by:
Is there a way to disable a button to disallow a user to click on it more than once? Thanks!
3
7142
by: James | last post by:
Hello, I am having a problem with a MS Access 2000 Database that I partially helped create. I am recording visits that registered customers make to our store. I have a list of all the elidgible people that can shop, and when I click a button, it records a visit for today in Date/Time format. My problem is that the button that records the visit can be clicked multiple times, and I am trying to find a way to lock it for a few seconds so...
8
8079
by: julietbrown | last post by:
I have a Save button I programmed myself to do a load of complicated validation before saving the record. It's ALL done in code, including writing the record out to file via a recordset edit operation. (I think this is probably a mad thing to do anyway! See later.) So, I want to disable Ctrl+S, as that bypasses all my validation. Is there a way to do that? A very pathetic question now ... I'm sure I should be able to do all my validation...
0
8991
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
8830
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
9541
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
9321
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,...
0
8242
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
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
6074
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();...
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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.