Results 1 to 12 of 12
  1. #1
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60

    About Button Features

    Hello,


    You know, wew can open any form with criteria like this codes;
    Code:
    DoCmd.OpenForm "Form Name", acNormal, , "[ID]=" & Me.ID
    I want to like this code for button feature adjestment. For example, I want to enable the button1 with criteria.
    I know, "Me.Button1.Enabled=True" code is working always but this code is not incluyding any criteria. I want to like this: ID=1 record Button1 must be enabled=True..
    Is that possible? Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Yes, button controls can be conditionally enabled/disabled. It's just If Then code. However, I don't understand your criteria. Why would it matter if the record ID is 1?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,421
    Maybe in the form_current event:
    If Me.ID = 1 then button1.enabled = true

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    Would need Else for when the ID is not 1. This can be done without If Then Else with simply:

    Me.button1.Enabled = Me.ID = 1
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60
    Ok, I'm asking again, please look at the attaced file. This is a continuous form and a1, a2 areas disable. When I push the ID1 line button, ONLY that "a1 text box" must be enable.(Not ID2 a1 text box) Question is this...ID must be criteria like
    Code:
    DoCmd.OpenForm "Form Name", acNormal, , "[ID]=" & Me.ID
    Attached Files Attached Files

  6. #6
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    You've completely reversed your scenario!

    In Post #1 you say "...I want to like this: (if) ID=1 record Button1 must be enabled=True...."

    Then, in Post #5 you write "...When I push the ID1 line button, ONLY that "a1 text box" must be enable.(Not ID2 a1 text box)..."

    Which is it? Are you trying to Enable the Textbox or the Command Button?

    If it's the Command Button, on a Continuous Form, you can't have it Enabled on Record and not on all Records...that's just the way Continuous Forms work. While you see multiple Buttons, only one Button Control actually exists.

    You'd have to use a Textbox in place of the Command Button, tweak its Formatting to look like a Command Button, then use Conditional Formatting (off of the Menu or Ribbon) to Enable/Disable it.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  7. #7
    Eugene-LS's Avatar
    Eugene-LS is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2018
    Location
    Murmansk
    Posts
    17
    notrino try file below:
    kritere_gore_denetim_ozelligi_v03.zip

  8. #8
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60
    Hello everybody,

    Yes, Eugene_LS, you understand me and you sent me true solution. Thank you so much..

  9. #9
    Eugene-LS's Avatar
    Eugene-LS is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2018
    Location
    Murmansk
    Posts
    17
    Quote Originally Posted by notrino View Post
    Yes, Eugene_LS, you understand me and you sent me true solution. Thank you so much..
    notrino - Name your DB objects in English only (Captions = Free), or you will have troubles with opening it in computers with other language setting
    I did not immediately understand why your application does not work for me
    I have:
    Win10 x64 Pro RUS + MSO 2010 x86 ENG ... for example.

  10. #10
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60
    Ok Eugene-LS, you are right..Thanks.

  11. #11
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60
    Eugene_LS,
    I want to ask something about this application. Your solution is working well but when I do same things, (create table, create form, controls, write your codes etc..) my application is not working. Why? Have your solution including any hidden module or query etc? Because my objects and your objects are, all of them same!Thanks..

    Not: I attached my solution..
    Attached Files Attached Files

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,956
    No idea why, but your db does not like the Load event for this form. Sometimes corruption happens without apparent reason and cannot be fixed. I created a new form, copy/pasted all controls, set up event code. New form works. Delete old form. Rename new form. However, Compact & Repair had an issue. It renamed the database.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Calendar Features
    By Voodeux2014 in forum Forms
    Replies: 2
    Last Post: 05-13-2015, 09:40 AM
  2. Features removed from 2013?!
    By jmhultin in forum Access
    Replies: 2
    Last Post: 03-11-2013, 11:13 AM
  3. optional features for UDF (Enum problem?)
    By maxbre in forum Programming
    Replies: 3
    Last Post: 11-11-2011, 04:16 PM
  4. Features Left in or out of 2010
    By Paul H in forum Access
    Replies: 7
    Last Post: 11-08-2011, 12:57 PM
  5. Removing access features
    By GraemeG in forum Programming
    Replies: 1
    Last Post: 03-10-2011, 11:12 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