0

这是我尝试自己编写的第一段代码,所以请原谅任何菜鸟错误。

如果第一个消息框没有选择但没有运气,我正在尝试显示第二个消息框。任何帮助都会很棒。

代码如下:

    Private Sub cmdUploadReady_Click()

Dim Msg, Style, Title, Help, Ctxt, Response, MyString

Msg = "Before Uploading Hole Data you must register you Work Program/POWE. Have you done this?"
Style = vbYesNo + vbCritical
Title = "Uploader"


Response = MsgBox(Msg, Style, Title, Help, Ctxt)

If Response = vbYes Then
'make pickers visible
Me.POWENumber_Label.Visible = True
Me.POWE_picker.Visible = True
Me.cmdUploadHoles.Visible = True


Else

Msg = "MsgBox do you wish to register now?"
        Style = vbYesNo + vbQuestion
        If Response = vbYes Then
        DoCmd.OpenForm "frmWorkPrograms_new"

        Else
        Cancel = True

        End If


End If

End Sub

提前喝彩。

4

1 回答 1

0

试试下面的代码。需要添加这一行 Response = MsgBox(Msg, Style, Title, Help, Ctxt)

  Private Sub cmdUploadReady_Click()

        Dim Msg, Style, Title, Help, Ctxt, Response, MyString

        Msg = "Before Uploading Hole Data you must register you Work Program/POWE. Have you done this?"
        Style = vbYesNo + vbCritical
        Title = "Uploader"


        Response = MsgBox(Msg, Style, Title, Help, Ctxt)

        If Response = vbYes Then
            'make pickers visible
            Me.POWENumber_Label.Visible = True
            Me.POWE_picker.Visible = True
            Me.cmdUploadHoles.Visible = True


        Else

            Msg = "MsgBox do you wish to register now?"
            Style = vbYesNo + vbQuestion
            Response = MsgBox(Msg, Style, Title, Help, Ctxt) '***Add this line****'

            If Response = vbYes Then
                DoCmd.OpenForm "frmWorkPrograms_new"

            Else
                Cancel = True

            End If


        End If
于 2013-03-05T05:46:34.203 回答