在messageBox中显示一个optionButton的结果

我在用户表单中显示所选选项时遇到问题。 我有2个名为opt750选项button,其值是750,另一个是opt1000 ,值是1000.select后,应显示在信息框中。 我试过的代码如下,这是用户点击确定button时要显示的全部消息:

 MsgBox "Date Received : " & vbTab + vbTab + date.Value + vbNewLine & _ "Amount Received : " & vbTab + amount.Value + vbNewLine & _ "Received Type: " & vbTab + vbTab + acnType.Value + vbNewLine & _ vbNewLine & _ "Received the amount of : " 'this is where I should 'call the result of the selected option button 

我喜欢将结果显示在msgbox中,如下所示:

 Date Received : 01/01/2011 Amount Received: 10000 Received Type: ATM Received the total amount of : 750 'if the button selected is 750 otherwise, 1000 

非常感谢!

假设你有一个像下面的选项的用户表单…

在这里输入图像说明

点击确定button消息框将显示我的下面的代码基于用户select选项。

  Private Sub CommandButton1_Click() Dim amt As Integer If (opt750) Then amt = 750 ElseIf (opt1000) Then amt = 1000 Else amt = 0 End If MsgBox "Received the amount of :" & amt End Sub