Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    San Francisco, CA, USA
    Posts
    184
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to exit out of a Subform into another? (2002)

    I have two subforms on a tabform.
    When I tab from various controls and then in the job subform and tab down to the last control, it does not tab into the other subform. How do I get out of this subform?
    Frank

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How to exit out of a Subform into another? (2002)

    There is no automatic tabbing between subforms and none out of a subform back to the parent form. You have to write code to handle setting the focus to the next subform control and then to a control on that subform. You can either do it from the Exit event of the last control in the tab order of a subform or create a zero-width control that has no other purpose except to set the focus to the next subform.
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    352
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How to exit out of a Subform into another? (2002)

    Hi Frank, Your magnum Opus must be getting near complete by now!

    What happens when you are on the last control and press tab? Does it jump to the first control on the form? To the first control on the next records in the subform or what?

    The direction I would look at might be to look at putting some code in the OnExit event of the control like
    Forms!MainForm.OtherSubform.setfocus
    firstControlOnOtherSubform.setfocus

    (I think you cannot make it jump straight to a control, on a subform)

    however if the recordset does not allow adding new records and the Cycle property of the form is set to all records, you may need to use a keypress event because the tab will never make it exit the control on the last record in the recordset.

    HTMS (Hope this makes sense)
    David Grugeon
    Brisbane Australia

  4. #4
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    San Francisco, CA, USA
    Posts
    184
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Works great!

    Well thanks Charlotte and David.
    The code worked perfectly and went to the exact control I needed it too on the other subform!
    Private Sub GI_Exit(Cancel As Integer)
    Forms![60300-frmJobCost-MainForm]![lstCustomers].SetFocus
    DoCmd.GoToControl "30700-frmJobLog-Expense-NonBillable-SubSubform"
    DoCmd.GoToControl "Date"
    SendKeys "{Tab}"
    End Sub

    It would not make cboCategory which is next to Date dropdown. So I first went to Date and then tabed to cboCategory-works wonderfully!
    Well the project is winding down. I can not believe the hundreds of items I've had to deal with. Well we will see shortly how it works out in the real world with the wogs.
    The database is fairly secure with the switchboard and shift-key disabled. Thought it was secure till another lounger said you could just import the forms etc into another database a crack it open.
    I been reading a couple of thick tombs about the security wizard etc. Thought that would do it then read you have to go out of access and set WorkGroup security in Windows or a person could just make a duplicate Workgroup to crack throught all your security in Access-very depressing.
    Well here's to all our magnum Opus's. <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Frank

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •