Hi there,
I'm fairly new to VB programming. I am struggling to find out how to use a msg box to display the value of a variable.
I've tried a number of permutations, and searched for hours to find a tip.
Any suggestions very welcome!
My code is currently:
Private Sub btnShowTotalCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowTotalCost.Click
If (radCorpTravel.Checked) Then
msg = MsgBox("Total for Corporate Vehicle Travel Costs: " + CorpCost, 0 + 48 + 0, "Corporate Vehicle Travel Costs")
ElseIf (radPrivTravel.Checked) Then
msg = MsgBox("Total for Private Vehicle Travel Costs: " + PrivCost, 0 + 48 + 0, "Private Vehicle Travel Costs")
Else
msg = MsgBox("Total for All Vehicle Travel Costs: " + AllCost, 0 + 48 + 0, "All Vehicle Travel Costs")
End If
End Sub
CorpCost, PrivCost & AllCost are the variables.
Many thanks
I'm fairly new to VB programming. I am struggling to find out how to use a msg box to display the value of a variable.
I've tried a number of permutations, and searched for hours to find a tip.
Any suggestions very welcome!
My code is currently:
Private Sub btnShowTotalCost_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowTotalCost.Click
If (radCorpTravel.Checked) Then
msg = MsgBox("Total for Corporate Vehicle Travel Costs: " + CorpCost, 0 + 48 + 0, "Corporate Vehicle Travel Costs")
ElseIf (radPrivTravel.Checked) Then
msg = MsgBox("Total for Private Vehicle Travel Costs: " + PrivCost, 0 + 48 + 0, "Private Vehicle Travel Costs")
Else
msg = MsgBox("Total for All Vehicle Travel Costs: " + AllCost, 0 + 48 + 0, "All Vehicle Travel Costs")
End If
End Sub
CorpCost, PrivCost & AllCost are the variables.
Many thanks