Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    Setting focus on a tabbed form


    I have a form with 1 tab control, containing 4 pages. When the form is opened, the focus is set for the first field on page 1. If I click on any of the other pages, then go back, and click on page 1, I cannot get the focus set to the first field on page 1. It always goes to the second field, and since the first field has not data, I receive an error. Within the properties of page 1, on the on click event, I've tried setting the focus, but it's not working. Any suggestions?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    How are you setting focus to the first field when form opens - code or Tab Order?
    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
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    tab order property. I've been reviewing everything, and I can't figure it out. If I click back and forth between the 4 pages, nothing works consistently.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Odd, I use tab control and have not encountered that issue.

    Because you did not include tables, I had to remove all the RecordSource and RowSource entries and the Load event so form would open without error. Not seeing the issue. Clicking on any tab puts focus on the control with TabIndex 0.
    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
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I can't duplicate your error without tables with some data in them, can you recreate your sample database and put in your tables, just make a copy of your database and delete or redact any sensitive information and only give the bare minimum to replicate the error and tell us exactly what you're doing to cause the error to occur. After I removed all reference to your tables etc when I clicked on the first tab it went to the first field so there's something going on when you actually have data in it.

  6. #6
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Here's a better copy of the DB.

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Hrm I still can't replicate your error.

    By first page I assume you mean the tab labeled Add Print Run ID

    if I click on any other tab then back to this tab it goes to the field PRINT RUN ID. Which from your description of the problem, is what you want it to do. Can you explain exactly what you are doing so I can try to replicate the problem. (use the exact label/object names you are referring to)

  8. #8
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks for looking at this. Try switching a few times. The error doesn't always happen.

  9. #9
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I've tried clicking tabs in random/rapid succession then going back to the tab labeled ADD PRINT RUN ID and it always defaults to the first field (named Text7). I am not changing or clicking anything else. If you are able to produce your error this way I am unable to.

  10. #10
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    I guess I'm the lucky one. It sounds like you're doing exactly the same thing I'm doing, but I'm getting the error message. As you've probably noticed, when the form is initially opened, the focus is within the "Print Run ID" field. If the user tabs to the next field without entering any data, a message box appears stating "Please enter a Print Run ID." And the focus returns to the "Print Run ID" field. I am requiring data within the print run ID field and PCL title field. If the focus is on purchase order number combo box, it checks to see that a PCL Title has been entered. When I receive the error message, it is "Please enter a PCL Title." That is the message that could appear on got focus for combo2. So, when I'm receiving the message, I've been clicking back and forth between the various tabs, and then that message appears. So, it looks like the focus is being placed on the combo2.
    In creating the DB that I uploaded, I removed most of the confidental data. The tables are linked tables, either to the back end DB or to an ODBC data source.
    Thanks again for your assistance!

  11. #11
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    What error message, that's the first time you've mentioned one. Are you talking about your own error message (the one about you must have an ID) or are you talking about a system generated error message?

    This database still doesn't function the way you have it because the table tblMasterTitle is linked and you have code that's referencing that table. Can you put that table in with some appropriate fake data to make this function as it is on your end.

  12. #12
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    The message that I've created. I'll upload a better quality DB. I'll make sure everything is working. It's going to take me a little time. Here's the DB. I think I have everything working that you will need.

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    I still don't get the issue.

    You really want to append 189 rows to some table every time the form opens? Didn't matter if I canceled the append and continued with form open or allowed the append, still no problem with clicking tabs.
    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.

  14. #14
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    I wonder why you are unable to duplicate the problem. Within my access settings, I have the confirmaton of record changes and action queries turned off. I click on those tabs, and the messages come up. I cannot get the focus to be set to the "Print Run ID" field. I just tried it, and it's not working properly.

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Okay, just changed those settings and still no issue. I am testing the file with Access 2007 - will try with Access 2010 at home.

    Have you tried the file on other machines?
    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.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Information in tabbed form
    By dunnmel4 in forum Forms
    Replies: 7
    Last Post: 03-27-2011, 04:32 PM
  2. Tabbed form
    By leftylee in forum Forms
    Replies: 6
    Last Post: 03-14-2011, 12:45 AM
  3. can a tabbed form be too big? Help!
    By ma t in forum Forms
    Replies: 3
    Last Post: 03-10-2011, 10:03 AM
  4. Tabbed Sub Form
    By Vikki in forum Access
    Replies: 1
    Last Post: 02-10-2010, 10:30 AM
  5. Setting Focus on a Form
    By MFeightner in forum Forms
    Replies: 1
    Last Post: 07-30-2009, 07:49 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