Results 1 to 9 of 9
  1. #1
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86

    Subforms and Tab Control?

    Good Morning All,



    I have a form with 2 subforms on it. The 1st subform is data entry....the 2nd subform is just a listbox of a query of the 1st subform.

    At the top of the main form I have a few data entry boxes.


    What I want to do is tab thru the boxes on main form......then go to 1st box in 1st subform....then I want tab order to stay on that subform and just keeping dropping down to new record.

    Currently it is tabbibg thru main form (good)....then tabbing thru all fields of 1st record (also good).....then it wants to tab to another record on the main form???

    Any ideas?

    Thanks,
    Kevin

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    I just tested this and can't replicate issue. Do you want to provide project for analysis? Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    Quote Originally Posted by June7 View Post
    I just tested this and can't replicate issue. Do you want to provide project for analysis? Follow instructions at bottom of my post.
    Here is the db.... Select "Sterilization Menu" from the main menu....then "Edit Load Log"......this is the form I am working on.

    It should Tab thru....Load Date, Autoclave #, Load Number, Employee, BI toggle.....then tab to 1st subform...Department ID, Instrument ID, Set ID, Implants, Quantity....then tab to the next record on this subform.......I want it to continue to tab on this subform until user clicks back onto main form or close...... I am not sure how to accomplish this.

    Thanks
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Am testing with Access 2007 but 2010 should be same. I expanded the first subform so could see 3 records. I tab through the main form controls and into the subform and continue tabbing through each record of subform. When it enters new record row must enter data or it will tab out of the subform into the MainTotalQty textbox and then to the second subform, tab through each record of second subform then out to main form next record.

    Might want to set TabStop property to No for textbox MainTotalQty and the second subform.

    If you don't want it to move to next record of main form set the Cycle property to CurrentRecord.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    I think I know the problem..... on the After Update event of "Quantity" box of the 1st subform...I have it set to Forms!frmLoad.Requery so that the new record entry of the 1st subform will show up in the 2nd form.....(Query of 1st subform)

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Good catch. In my test I did not enter Quantity. I tried code that would requery just the second subform, even changed the subform container control name and can't get anything to work.

    Frankly, I don't understand need for second subform which is actually a duplication of the first subform.
    Last edited by June7; 05-26-2012 at 10:14 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86
    Quote Originally Posted by June7 View Post
    Good catch. In my test I did not enter Quantity. I tried code that would requery just the second subform, even changed the subform container control and can't anything to work.

    Frankly, I don't understand need for second subform which is actually a duplication of the first subform.
    Thanks June7 .....you're always great help.

    First - the reason I created the second subform was so that the user could have a running list of items they are entering in the Load. I utilized cascading comboboxes in the first subform and each time the user went to the next record....the info from the previous record would lose focus if they chose a different department. My remedy (the only one I could figure out) was to minimize the 1st subform so the user only could see the record currently working on and create 2nd subform that would just query the table and show what had been entered for the current LoadID.

    Hope that explains my reasoning....you probably don't remember (been working on this project for a year!) but you actually helped me alot with this. This was one of my biggest obstacles with this db.



    Now - I have an idea....can this be done...... In the AfterUpdate event code for the Quantity box of the 1st subform (the one that I currently have requery the form) can I have it requery and then goto the first field in the next record somehow?


    Thanks Again for your help!
    Kevin

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Yes, that does sound familiar now and understand.

    Try:

    1. set TabStop No for textbox MainTotalQty and the second subform

    2. code in Quantity AfterUpdate: Form_frmLoad.Refresh. Will have to press Tab or Enter twice to leave the control and go to next record, but the second subform will populate.

    3. In the GotFocus event for each combobox, might find the Dropdown method handy, example: Me.EmployeeID.Dropdown

    4. Run Debug Compile and remove a bunch of non-functioning subs.

    The only alternative to the second subform is listbox.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Kevo is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Location
    Kodiak, Alaska
    Posts
    86

    Smile

    Thanks June!

    Not sure what I did (unfortunately) but it now is working!


    On to the next little issue......

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

Similar Threads

  1. Replies: 3
    Last Post: 03-29-2012, 12:40 PM
  2. Hide each control, control group or subform?
    By BRV in forum Programming
    Replies: 2
    Last Post: 12-09-2011, 09:36 AM
  3. Replies: 6
    Last Post: 03-14-2011, 09:37 AM
  4. Replies: 1
    Last Post: 11-25-2010, 11:00 AM
  5. Control addressing on subforms
    By JB in forum Access
    Replies: 1
    Last Post: 12-09-2005, 09:14 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