Results 1 to 6 of 6
  1. #1
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102

    open form to a record and the focus on a field on the opened form from a command button and combobox

    Hi all, I have a dilemma, I have looked through the internet and found many ways of setting focus on a form when it opens, that's fine and dandy, however, I would like to set the focus from another from from a command button.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,899
    Just go through the Forms collection. http://access.mvps.org/access/forms/frm0031.htm
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  3. #3
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102
    Hi thanks for your quick reply, but your answer refers to forms and subforms, I have a combobox and command button on entirely different form, the user chooses a record from the combo then clicks the command button which opens the form to that specific record, what I want to achieve is when that other form opens to go to a specific field for data entry, but not want the form to open to that field when it opens from another method, hope that makes sense.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,899
    Forms.YourOtherFormName.TheControlYouWant.SetFocus.
    ...using your values of course.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  5. #5
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102
    Hi ruralGuy, I beat you to it, just came on to tell you I've solved it with exactly the same solution, just came to me like a eureka moment, but thanks for confirming my solution

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,899
    Glad we're on the same track. Thanks for posting back with your success.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

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

Similar Threads

  1. Using command button to query and open form
    By annienelson621 in forum Forms
    Replies: 2
    Last Post: 03-26-2015, 08:05 AM
  2. Replies: 2
    Last Post: 11-01-2013, 09:57 AM
  3. Replies: 2
    Last Post: 05-11-2012, 11:52 AM
  4. Replies: 11
    Last Post: 01-26-2012, 01:22 PM
  5. Use a command button to open a form
    By johnpaul in forum Forms
    Replies: 24
    Last Post: 09-23-2010, 12:29 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
  •  
Tech Forums: Microsoft Office Forums