More to Command Button

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fong.yang@martecgroup.com

    #1

    More to Command Button

    I'm a newbie to Access and programming.
    I used the wizard to create a command button to go to next record on a
    form.The following is the code:

    Private Sub Command135_Clic k()
    On Error GoTo Err_Command135_ Click
    DoCmd.GoToRecor d , , acNext
    Exit_Command135 _Click:
    Exit Sub
    Err_Command135_ Click:
    MsgBox Err.Description
    Resume Exit_Command135 _Click

    End Sub

    The way it is right now the button just goes to the next record. I
    want to be able to display a message" Do you want to go to next
    record?" If user clicks yes then go to next record, If user click no
    then stays on the same record.

  • salad

    #2
    Re: More to Command Button

    fong.yang@marte cgroup.com wrote:[color=blue]
    > I'm a newbie to Access and programming.
    > I used the wizard to create a command button to go to next record on a
    > form.The following is the code:
    >
    > Private Sub Command135_Clic k()
    > On Error GoTo Err_Command135_ Click[/color]
    If msgbox("Go To Next Record?",vbQues tion + vbYesNo, "Confirm GO") =
    vbYes then DoCmd.GoToRecor d , , acNext
    [color=blue]
    > Exit_Command135 _Click:
    > Exit Sub
    > Err_Command135_ Click:
    > MsgBox Err.Description
    > Resume Exit_Command135 _Click
    >
    > End Sub
    >
    > The way it is right now the button just goes to the next record. I
    > want to be able to display a message" Do you want to go to next
    > record?" If user clicks yes then go to next record, If user click no
    > then stays on the same record.
    >[/color]

    Comment

    Working...