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

    Moving from one subform to the next clears the information in the first subform

    Hi,



    I'm doing an invoicing system and experiencing a problem on the invoice form.

    InvoiceMainForm contains two subforms - ClientSubForm and QryLineItemsDataSubForm

    ClientSubForm links to InvoiceMainForm through the ClientId field and QryLineItemsDataSubForm links to the InvoiceMainForm through the InvoiceNumber field.

    The ClientSubForm appears first on the InvoiceMainForm and I want the user to be able to tab from the last text box on the ClientSubForm to the first text box on the QryLineItemsDataSubForm.

    So I put the following code onto the last text box of the ClientSubForm:
    Code:
    Private Sub ClientEmail_Exit(Cancel As Integer)
        Forms!InvoiceMainForm!QryLineItemsDataSubForm.SetFocus
        Forms!InvoiceMainForm!QryLineItemsDataSubForm.Form!QtySold.SetFocus 
    End Sub
    This works in that it moves the cursor to the correct field in the QryLineItemsDataSubForm, but it also clears all the information from the ClientSubForm, except for the ClientId.

    Can someone please help me to either fix the navigation or fix the clearing of the client information? Below is an image of my table relationships.
    Click image for larger version. 

Name:	ERD.PNG 
Views:	9 
Size:	55.7 KB 
ID:	11282

    Thanks
    Hanlie

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Try changing the Cycle property of the form being exited.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pinghanling is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2013
    Posts
    2
    Thanks for the reply.

    I set the Cycle property to 'Current record' and it works the way I want it now.

    Cheers
    Hanlie

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Happy to help, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 05-16-2012, 10:52 AM
  2. Subform moving line and label
    By hawkins in forum Reports
    Replies: 1
    Last Post: 08-16-2011, 11:15 PM
  3. Moving focus out of the subform
    By injanib in forum Forms
    Replies: 6
    Last Post: 06-20-2011, 03:45 PM
  4. Replies: 4
    Last Post: 01-03-2011, 10:54 PM
  5. Replies: 2
    Last Post: 08-20-2010, 04:50 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