Results 1 to 10 of 10
  1. #1
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79

    in simple terms on form1 i want users to click button two before button three is it possible?

    Hello,




    is it possible to have on form1 i want users to click button 1 before button 2 is it possible? the requirement is both buttons has to be on the same page.

    i tried the attempt of button.enabled = true or false
    but due to complexity of project according to me doesnt make it work.
    the form is unbound

    i want something like

    If Forms!FormA!listbox!.ListIndex > 0 Then ( note this line is part of filter code section).

    get users to click on button 2 before button 3

    i even tried .....


    If Forms!CheckAvailability!lstRoom.ListIndex > 0 Then <------ this line is also part of filtered applied to the next form
    If Forms!CheckAvailability!lstRoom.OpenArgs = "cmdRoomAvailability" = False Then
    Me!btnBookRoom.Enabled = False
    Else
    If Forms!CheckAvailability!lstRoom.OpenArgs = "cmdRoomAvailability" = True Then
    Me!btnBookRoom.Enabled = True
    End If


    spent all night on this and dont know anymore.

    please help, thank you





    kind regards

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    How about set button1.enabled = False on form open event and when button2 is clicked set button1.enabled = True in the button2 afterupdate event?

  3. #3
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79
    ok, thank you for your direction, but there is no afterupdate event on the property sheet where i can put my code in. there got on got focus, on enter, on exit etc.
    i tried it on got focus, it works but then my listbox is not validated, meaning if listbox is not selected then dont call on got focus else if selected call on got focus.

  4. #4
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Sometimes there are more events available in than you can see in the property sheet. If you are in the Code Editor, there are 2 drop down boxes above the code. Choose Button2 from the first drop down on the left, and AfterUdpate on the Right Dropdown.

    http://catalogue.pearsoned.co.uk/ass...0273749218.pdf
    See Page 16 Figure 2.12, shows the 2 drop down boxes I speak of. There should be similar ones in the VBA IDE.

  5. #5
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79

    attached img

    i tried that right now and it not there, there is no after update or even before update

  6. #6
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79
    are there any alternatives to afterupdate of button, thanks

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Buttons don't have Update events. Use click event.

    Are all these controls (buttons and listbox) on the same form? Is form in Single View?
    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.

  8. #8
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79

    attached db

    yes all controls are in same form - single view. what am trying to do is check availability of rooms from listbox then transfer that information to the booking form to book the "available room" only, which is why i want users to click check availability button before booking buttons. how can i implement click event with this. i tried button.enabled = false or true. it doesnt work

    here is the attached db

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Instead of forcing user to click a button to see availability, why not structure a combobox to list only those rooms that are available for given date?

    Booking type database topic of numerous threads. Here is one https://www.accessforums.net/code-re...ays-49891.html


    The MS Desktop Lending Library template probably has something like that - books that are already lent would not be listed as available. Desktop Asset Tracking template might also do the same.
    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.

  10. #10
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79
    thank you but that was not my requirement. however i want to thank you so much because of your suggesstion i found that i should have put the code in a different form, and now it works how it should be, thank you so much

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

Similar Threads

  1. Right Click Button
    By Derrick T. Davidson in forum Forms
    Replies: 1
    Last Post: 02-03-2015, 10:03 PM
  2. Button click
    By hendrikbez in forum Forms
    Replies: 7
    Last Post: 11-18-2014, 01:51 AM
  3. Replies: 9
    Last Post: 09-25-2014, 11:34 AM
  4. Trying to click a button in vba
    By boywonder in forum Programming
    Replies: 8
    Last Post: 05-02-2011, 04:34 AM
  5. +1 on button click
    By 10 Gauge in forum Forms
    Replies: 4
    Last Post: 02-14-2011, 06:51 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