View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_3_] Patrick Molloy[_3_] is offline
external usenet poster
 
Posts: 27
Default Value is not displayed on the screen

It may be that your text does not display if the
conditions don't satisfy your conditions. I see at least
TWO missing ELSE staements where you would miss putting
in values. Take a look at the following - I made one
small adjustment, and included the two missing else's -
you can fill the missing code...

If txtDmdPeak.Text <= txtDtotal.Text Then
'Firm - Normal Bill
If Answer = True Then
If txtCalculatedDemand.Text < txtDsbf.Text Then
txtFirmStandbyCharge.Text = (txtDsbf.Value -
txtCalculatedDemand.Value) * txtMaxDmcFirm.Value
If txtFirmStandbyCharge.Value = "" Then
txtFirmStandbyCharge.Value = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If

Else ' I changed from your code
' why use IF here??
If txtCalculatedDemand.Text < txtDtotal.Text Then _
txtFirmStandbyCharge.Text = (txtDtotal.Value -
txtCalculatedDemand.Value) * txtMaxDmcNonFirm.Value
If txtFirmStandbyCharge.Text = "" Then
txtFirmStandbyCharge.Text = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
Else

'????

End If

End If
Else
'????? Not normal bill

End If


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
When I do this coding in VBA:
================================================= ========
If txtDmdPeak.Text <= txtDtotal.Text Then
'Firm - Normal Bill
If Answer = True Then
If txtCalculatedDemand.Text < txtDsbf.Text Then
txtFirmStandbyCharge.Text = (txtDsbf.Value -
txtCalculatedDemand.Value) * txtMaxDmcFirm.Value
If txtFirmStandbyCharge.Value = "" Then
txtFirmStandbyCharge.Value = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
End If

If txtDsbf.Text < txtCalculatedDemand.Text Then
If txtCalculatedDemand.Text < txtDtotal.Text Then
txtFirmStandbyCharge.Text =

(txtDtotal.Value -
txtCalculatedDemand.Value) * txtMaxDmcNonFirm.Value
If txtFirmStandbyCharge.Text = "" Then
txtFirmStandbyCharge.Text = "0"
Else
txtFirmStandbyCharge.Value = Format
(txtFirmStandbyCharge.Value, "######.##")
End If
End If
End If
================================================= =======

It does not display the results on the screen for this
particular textbox. Is there anything wrong with the
properties which I set?

Thanks.
.