Results 1 to 7 of 7
  1. #1
    nitinrao is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    8

    Question Submit Button:How can I assign a button to go to the next record and its first field?

    I'm trying to set up a "Submit Button" which will allow you to go to the next record and the first field of the record upon clicking or pressing enter on it (in a form).


    How can set up this command?

    Thanks in advance!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    The Command Button wizard know how to make a button that goes to the next record. Have you tried it?

  3. #3
    nitinrao is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    8
    Quote Originally Posted by RuralGuy View Post
    The Command Button wizard know how to make a button that goes to the next record. Have you tried it?
    I tried to use the command button wizard, but it only allows me to go to a new record - but not the new field. If I were to do this using set focus, how would my code look like? I want to set the focus on the field called "Last Name" (please see my attached pic of the form)

  4. #4
    MAF4Fam6's Avatar
    MAF4Fam6 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Fruit Heights, Utah USA
    Posts
    140
    Have you tried customizing your fields' Tab order on your form?
    Go to your form's Property Sheet > Other Tab > Tab Index and try changing the Custom Order of your fields.

    -RC

  5. #5
    nitinrao is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    8
    Quote Originally Posted by MAF4Fam6 View Post
    Have you tried customizing your fields' Tab order on your form?
    Go to your form's Property Sheet > Other Tab > Tab Index and try changing the Custom Order of your fields.

    -RC
    I have, but I have subforms in my tab index...so tab won't help me get to the new field of the new record.
    But please let me know how I should insert the setfocus code.

  6. #6
    MAF4Fam6's Avatar
    MAF4Fam6 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Location
    Fruit Heights, Utah USA
    Posts
    140
    Quote Originally Posted by nitinrao View Post
    I have, but I have subforms in my tab index...so tab won't help me get to the new field of the new record.
    But please let me know how I should insert the setfocus code.
    I'm sorry. I'm not the expert at VBA. I wish I new the code to better assist you. I'm more of an expert in Macros. Let me know if you are interested going this route (Macro) if you still can't find a solution through code.
    Thanks.

    -RC

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Setting the focus is easy but that picture you posted liiks like a main form and the TabIndex would accomplish what you want as MAF4Fam6 suggested. If you don't want to use the TabIndex then post the code the wizard created for your Submit button and we'll add a SetFocus line for you.

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

Similar Threads

  1. Replies: 11
    Last Post: 01-21-2010, 11:01 AM
  2. Replies: 3
    Last Post: 01-14-2010, 08:32 AM
  3. Command button help - delete record
    By Zukster in forum Forms
    Replies: 0
    Last Post: 08-27-2009, 08:47 AM
  4. make Add Record button work
    By janjan_376 in forum Forms
    Replies: 3
    Last Post: 06-05-2009, 04:22 AM
  5. Find Record button error
    By Zedlexx in forum Forms
    Replies: 0
    Last Post: 03-11-2009, 09:26 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