Results 1 to 2 of 2
  1. #1
    ukaquanaut is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    2

    Question Changing focus from a popup form to a main form with a datasheet subform


    Hi Guys

    I have a Form which has a datasheet subform, The user has a''search as you type popup form' to search stock items and find the code for one of the controls in the datasheet.

    I have managed to get a double click to enter the stock code of the selected item into the subform data sheet control, but I cant manage to get the focus set back there so the user can tab onto the next control in the subform datasheet.

    I have tried a variety of form addressing, but I cant seem to progress with this.

    I expect its a comon problem but I cant find a solution and have spent hours googling for it.

    the address for the control that gets data inserted is:

    Forms!FrmSearchTest.Form!FrmSubSearchTest!StockCod e = lstItems

    And this works perfectly, I simply need to set the focus to the same control now.

    I have tried to do in two steps, to set focus on the main form forst FrmSearchTest

    and then to the datasheet subform control StockCode, but while this doesnt give an error, it doesnt work either??

    Forms![FrmSearchTest]!FrmSubSearchTest.SetFocus
    Forms![FrmSearchTest]!FrmSubSearchTest.Form!StockCode.SetFocus

    Any thoughts would be appreciated.

    Jerry

  2. #2
    ukaquanaut is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2012
    Posts
    2
    Quote Originally Posted by ukaquanaut View Post
    Hi Guys

    I have a Form which has a datasheet subform, The user has a''search as you type popup form' to search stock items and find the code for one of the controls in the datasheet.

    I have managed to get a double click to enter the stock code of the selected item into the subform data sheet control, but I cant manage to get the focus set back there so the user can tab onto the next control in the subform datasheet.

    I have tried a variety of form addressing, but I cant seem to progress with this.

    I expect its a comon problem but I cant find a solution and have spent hours googling for it.

    the address for the control that gets data inserted is:

    Forms!FrmSearchTest.Form!FrmSubSearchTest!StockCod e = lstItems

    And this works perfectly, I simply need to set the focus to the same control now.

    I have tried to do in two steps, to set focus on the main form forst FrmSearchTest

    and then to the datasheet subform control StockCode, but while this doesnt give an error, it doesnt work either??

    Forms![FrmSearchTest]!FrmSubSearchTest.SetFocus
    Forms![FrmSearchTest]!FrmSubSearchTest.Form!StockCode.SetFocus

    Any thoughts would be appreciated.

    Jerry
    Update:

    OK I have discovered that the code lines to setfocus do actually work, the focus was moved as required, but because the popup form was still active.

    I have now closed the popup form and the focus remains where it's supposed to be. However, I would have like to have left the popup on the screen, if anyone has thoughts on this it would be appreciated.

    Regards
    Jerry

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

Similar Threads

  1. copy from popup form to main form
    By alex_raju in forum Forms
    Replies: 2
    Last Post: 02-10-2012, 05:29 PM
  2. Replies: 11
    Last Post: 01-26-2012, 01:22 PM
  3. Changing focus on a form
    By Shag84 in forum Forms
    Replies: 3
    Last Post: 07-15-2011, 01:51 PM
  4. Updating Main form from a popup form
    By wdrspens in forum Forms
    Replies: 21
    Last Post: 06-13-2011, 01:34 AM
  5. Form-Subform-Popup Problem
    By TrudyD1474 in forum Forms
    Replies: 1
    Last Post: 06-10-2010, 05:36 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