User Profile

Collapse

Profile Sidebar

Collapse
Synthologic
Synthologic
Last Activity: Oct 3 '11, 05:35 PM
Joined: Oct 3 '11
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Synthologic
    started a topic Disable a Button If a Textbox is empty

    Disable a Button If a Textbox is empty

    Hello,

    I am trying to disable the save or add new button if a textbox is empty on an access form but it is not working, the button is still enabled. So I disable in the button property's panel and flip the code to enable it but that does not work also.

    This is the code:

    Code:
    Private Sub form_load()
    If Len(Me.FIRST_NAME) = 0 Then
    Me.CommandAddNew.Enabled = False
    End If
    End Sub
    ...
    See more | Go to post

  • Well, I got the answer from the MS VBA forum, here is the code if anyone needs it!

    Code:
    Private Sub CommandAddNew_Click()
    If Me.NewRecord Then
    DoCmd.RunCommand (acCmdSaveRecord)
    DoCmd.RunCommand (acCmdRecordsGoToNew)
    End If
    End Sub
    SYN
    See more | Go to post

    Leave a comment:


  • Can I use a button on a form to save and go to new record at the same time on click?

    I wrote this piece of code:

    Code:
    Private Sub CommandAddNew_Click()
    If Me.NewRecord Then
    DoCmd.RunCommand (acCmdSaveRecord)
    Else
    DoCmd.RunCommand (acCmdRecordsGoToNew)
    End If
    End Sub
    What I am really trying to do is use a single button to save the record and go to new record. Meaning when the user click the button, the record is saved and there is a new form to enter a new...
    See more | Go to post
No activity results to display
Show More
Working...