I need for a check box when checked to verify whether a textbox has a certain value in it's field, and if it doesn't, it needs to create a MsgBox telling the user that they must enter an amount in that field. This is my code:
[CODE=vb]Public Function VerifyAmount()
Dim amount As Currency
amount = txtOpenBalance
If amount = 0 Then
MsgBox("Please Enter an Amount for the Open Balance", vbOKOnly, "Error") = vbOK
txtOpenBalance. focus = True
End If
End Function
Private Sub chkComplete_Cli ck()
VerifyAmount() = vbOK
End Sub[/CODE]
The problem is that on the line where i create the msgbox it gives me an error saying "Compile Error: Function call on left-hand side of the assignment must return Variant or Object"
How can I fix this?
[CODE=vb]Public Function VerifyAmount()
Dim amount As Currency
amount = txtOpenBalance
If amount = 0 Then
MsgBox("Please Enter an Amount for the Open Balance", vbOKOnly, "Error") = vbOK
txtOpenBalance. focus = True
End If
End Function
Private Sub chkComplete_Cli ck()
VerifyAmount() = vbOK
End Sub[/CODE]
The problem is that on the line where i create the msgbox it gives me an error saying "Compile Error: Function call on left-hand side of the assignment must return Variant or Object"
How can I fix this?
Comment