Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A nice easy one - VB code

Status
Not open for further replies.

dommales

MIS
Aug 10, 2001
10
GB
can someone explain this code please.

Private Sub WeekendDate_AfterUpdate()
'MsgBox [Bill Rate] & " " & [ContractorRate]
If [ChargeRate] = " " Then
[ChargeRate] = [Bill Rate]
Else
[ChargeRate] = [Bill Rate]

End If
End Sub

I'm having a dense day.

Thanks

Dom
 
Looks to me like it displays the BillRate and Contractor rate in a message box and then sets the ChargeRate to be BillRate. Doesn't seem to be much point in having an If statement really.

Still it is Friday, maybe I'm being dense too !!

Jane
 
The first part of the 'If' statement is curious. Actually it only fires if the charge rate has as space. But in any event the else would do exactly the same this, set the charge rate to the bill rate. All possibilities are covered by the code and they will ALWAYS do the same thing. Error in logic most probably.

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top