Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    navigation problems (Access 2000)

    Could you help me find the reason why my navigation buttons do not work? They are built on a custom toolbar, as shown in my attachement, and i want to look through all the customers in the form but i cant do that

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: navigation problems (Access 2000)

    In the first place, the subform sbfCalls1 is first in the tab order of the FCustomers form, so when you open FCustomers, the subform receives the focus.
    The toolbar buttons operate on the form that has the focus, so initially they will operate on the subform.
    If you want them to operate on the main form, make CustomerID or CompanyName the first control in the tab order (select View | Tab Order in design view to change the tab order)

    In the second place, the left button moves to the next record, and the right button to the previous record. This is not intuitive, at least not in countries like mine and yours, where we write from left to right. It would be better to exchange the buttons.

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

    Re: navigation problems (Access 2000)

    You have several problems, the most important of which is that the toolbar buttons have no idea of what recordset you're trying to navigate. Putting the line <code>Screen.ActiveForm.SetFocus</code> in each routine like this
    <hr>Public Function MoveOn()
    On Error Resume Next
    Screen.ActiveForm.SetFocus
    DoCmd.GoToRecord , , acNext
    End Function<hr>
    will cure that problem.
    The second problem is that the tab order of your form forces the focus to the subform, which isn't the recordset you seem to want to navigate. Changing the tab order so that either CustomerID or CompanyName gets the focus allows the navigation to work as you would expect.

    You could also specify the form and control to receive the focus if this toolbar will only be used with that form. In that case, the code would look like this:
    <hr>Public Function MoveFrom()
    On Error Resume Next
    Forms!fCustomers!CompanyName.SetFocus
    DoCmd.GoToRecord , , acPrevious
    End Function<hr>

    If you don't want the users to be able to change the CompanyName, you can lock that control, which will still allow it to receive the focus so that you can navigate the recordset.
    Charlotte

  4. #4
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: navigation problems (Access 2000)

    Thank you so much, Hans, for the kind help you have given to me.I have now a trouble free form

  5. #5
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: navigation problems (Access 2000)

    Thank you so much, Charlotte, for the kind help you have given to me.I have now a trouble free form

Posting Permissions

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