473,322 Members | 1,703 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,322 software developers and data experts.

Disable SAVE button

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 4514
JustJim
407 Expert 256MB
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 SomeOtherControl.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 Expert 2GB
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 Expert 256MB
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
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...
1
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...
6
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...
16
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
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...
6
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
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...
8
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.