Results 1 to 10 of 10
  1. #1
    School Boy Error is offline Advanced Beginner
    Windows 7 32bit Access 2013 64bit
    Join Date
    Oct 2012
    Posts
    72

    Exit input box or value is ignored


    Hi, I have a form where the staff choose a date range and some other parameters. I noticed earlier the date range was being ignored and finally figured out that if I didn't click out of the End Date box before pressing OK the End Date was ignored and the default value was used. How do I get the OK button to make sure that the input box values are used. This is a screen shot of the form - https://snag.gy/JgA1YT.jpg Thank you!

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    Can I recommend you use the image button to display your images. For security reasons, many (myself included) are not prepared to click on links to external sites

    With regards your problem, assuming OK is a button, it will get the focus when clicked so you will have moved the focus from the end date box. Implication being your code to create the WHERE clause is being created before the button is clicked

  3. #3
    School Boy Error is offline Advanced Beginner
    Windows 7 32bit Access 2013 64bit
    Join Date
    Oct 2012
    Posts
    72
    Sorry, I've uploaded the image now. I thought it was triggered from the OK button press - this loads a report that populates from the query data using information on the form... Do you know how I could check the order or change it? As you can tell, I'm very new to all of this!
    Attached Thumbnails Attached Thumbnails Form.jpg  

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    not sure what you have done, but there is only a blank image. Click on the insert image button (4th from the left) and follow the prompts

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    also, sounds like we need to see the code you are using - copy and paste this as text to your post and surround with the code tags (the # button) to preserve formatting

  6. #6
    School Boy Error is offline Advanced Beginner
    Windows 7 32bit Access 2013 64bit
    Join Date
    Oct 2012
    Posts
    72
    This should hopefully work. The code called is just one line so the focus doesn't go to the button - how do I do this or set the focus away from any of the input boxes?
    Attached Thumbnails Attached Thumbnails form and code.jpg  

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    Use Me.OK.SetFocus wherever necessary
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  8. #8
    School Boy Error is offline Advanced Beginner
    Windows 7 32bit Access 2013 64bit
    Join Date
    Oct 2012
    Posts
    72
    Quote Originally Posted by ridders52 View Post
    Use Me.OK.SetFocus wherever necessary
    Brilliant, thank you. I'll give it a go.

  9. #9
    School Boy Error is offline Advanced Beginner
    Windows 7 32bit Access 2013 64bit
    Join Date
    Oct 2012
    Posts
    72
    Worked perfectly! Thank you.

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    You're welcome
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 1
    Last Post: 11-04-2014, 12:07 PM
  2. Replies: 6
    Last Post: 10-27-2014, 08:05 PM
  3. Replies: 2
    Last Post: 12-20-2012, 03:06 PM
  4. How to end/exit a sub from its nested sub?
    By lookingforK in forum Programming
    Replies: 2
    Last Post: 12-10-2012, 02:13 PM
  5. exit
    By slimjen in forum Forms
    Replies: 4
    Last Post: 10-09-2011, 09:30 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