Results 1 to 2 of 2
  1. #1
    Newby is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Posts
    60

    Enabled or Disable a command button base on a field value upon activiating a form


    Upon activating a form with a record, I want to either enabled a command button or disable based on another record field value. I can do in excel with a user form, but do not know how in Access 2013

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    The best place to do that is probably the On current event:

    Code:
    If me!testfield = somevalue then
      me!commandbutton.enabled = True
    else
      me!commandbutton.enabled = False
    endif
    You have to include the "else" part because some records might meet the condition, others won't

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

Similar Threads

  1. Replies: 4
    Last Post: 02-24-2016, 09:29 AM
  2. Replies: 3
    Last Post: 09-15-2011, 09:06 AM
  3. Disable command button
    By rajulasb in forum Access
    Replies: 2
    Last Post: 08-04-2011, 05:32 AM
  4. Continuous Form Disable Command Button
    By mbake085 in forum Programming
    Replies: 4
    Last Post: 05-27-2011, 08:55 AM
  5. how to disable command button
    By archie in forum Access
    Replies: 1
    Last Post: 08-27-2009, 11:11 PM

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