Results 1 to 3 of 3
  1. #1
    Gina Maylone is offline Always learning
    Windows 10 Access 2016
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544

    Trying to disable buttons on main menu after certain date

    Hi everyone!

    I'm sending out a demo and have decided to disable the buttons on the main menu after a certain date (which is "currentdate" on the menu). But it's disabling them no matter what. What am I missing? I've tried changing my system date to no avail. Do I have my arrows backwards or something??

    Code:
    Private Sub Form_Current()
    
    Dim ctrl As Control
    For Each ctrl In Me.Controls
      
      If Forms!welcome!currentdate > 1 / 29 / 17 And TypeOf ctrl Is CommandButton Then
    
       ctrl.Enabled = False
    
    End If
    If Forms!welcome!currentdate < 1 / 29 / 17 And TypeOf ctrl Is CommandButton Then
        ctrl.Enabled = True
    
    
      End If
    
    Next
    
    End Sub
    TIA!

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Dates need to be surrounded by "#"
    #1/29/17#

  3. #3
    Gina Maylone is offline Always learning
    Windows 10 Access 2016
    Join Date
    Jun 2013
    Location
    Afton, MN
    Posts
    544
    DUHHHH! Thank you aytee111!! Much appreciated! Works perfect1

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 09-23-2016, 07:25 PM
  2. VBA disable Next and Last Buttons
    By Perceptus in forum Programming
    Replies: 5
    Last Post: 09-18-2016, 12:09 PM
  3. Replies: 15
    Last Post: 04-11-2015, 08:15 AM
  4. Menu buttons
    By lwcollin in forum Access
    Replies: 3
    Last Post: 07-11-2011, 10:58 AM
  5. Disable MSAccess Menu items
    By pkstormy in forum Code Repository
    Replies: 2
    Last Post: 09-06-2010, 01:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums