I still can't make this thing work!!!<br>
I've tried what I find in books to make the final resulting calculation (in LblEI.Caption) format for currency, but I can't get it to do it. As it's set up, I get a "." instead of a "," and if the last number in the answer is a "0" it drops it. Also, sometimes the answer will go to 4 decimal places. I've figured everything else out except for this.<br>
What I want is "$###,###" as a format. The numbers used for this calc are not currency, but I want the final result to be currency.<br>
Thanks!<br>
<br>
<br>
' if attendance is greater than peakroomcount<br>
' multiply peakroomcount by 1.8<br>
' whichever is less - attendance or new peakroomcount and multiply * 1.451<br>
<br>
Private Sub BookingFormula2()<br>
Dim Vara<br>
Dim Varprc&<br>
Dim Xprv<br>
Vara = Val(TxtAttend.Text)<br>
Varprc = Val(TxtPRC.Text)<br>
Xprv = Varprc * 1.8<br>
<br>
If Vara > Varprc Then<br>
Xprv = Varprc * 1.8<br>
If Vara < Xprv Then<br>
LblEI.Caption = Vara * 1.451<br>
Else: LblEI.Caption = Xprv * 1.451<br>
<br>
End If<br>
End If<br>
End Sub<br>
<br>
I've tried what I find in books to make the final resulting calculation (in LblEI.Caption) format for currency, but I can't get it to do it. As it's set up, I get a "." instead of a "," and if the last number in the answer is a "0" it drops it. Also, sometimes the answer will go to 4 decimal places. I've figured everything else out except for this.<br>
What I want is "$###,###" as a format. The numbers used for this calc are not currency, but I want the final result to be currency.<br>
Thanks!<br>
<br>
<br>
' if attendance is greater than peakroomcount<br>
' multiply peakroomcount by 1.8<br>
' whichever is less - attendance or new peakroomcount and multiply * 1.451<br>
<br>
Private Sub BookingFormula2()<br>
Dim Vara<br>
Dim Varprc&<br>
Dim Xprv<br>
Vara = Val(TxtAttend.Text)<br>
Varprc = Val(TxtPRC.Text)<br>
Xprv = Varprc * 1.8<br>
<br>
If Vara > Varprc Then<br>
Xprv = Varprc * 1.8<br>
If Vara < Xprv Then<br>
LblEI.Caption = Vara * 1.451<br>
Else: LblEI.Caption = Xprv * 1.451<br>
<br>
End If<br>
End If<br>
End Sub<br>
<br>