Disable SAVE button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KMEscherich
    New Member
    • Jun 2007
    • 69

    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.
  • JustJim
    Recognized Expert Contributor
    • May 2007
    • 407

    #2
    Originally posted by KMEscherich
    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

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      I think this might work a little better:
      [CODE=vb]Private Sub Form_Current()
      If Me.NewRecord Then
      YourSaveButton. Enabled = True
      Else
      If Not IsNull(YourDate TextBox) Then
      YourSaveButton. Enabled = False
      Else
      YourSaveButton. Enabled = True
      End If
      End If
      End Sub[/CODE] Good Luck!

      Linq ;0)>

      Comment

      • JustJim
        Recognized Expert Contributor
        • May 2007
        • 407

        #4
        Yes, that would do it nicely.

        Comment

        Working...