hàm (if va elseif ) nhiều điều kiện:
Private Sub cmdtinhtien_Click()
if noitru = 1 and tongchiphi >= 157500 and phantuyen = 1 and manhom = 4 or 5 then
chitra = tongchiphi*0.05
elseif noitru = 1 and tongchiphi >= 157500 and phantuyen = 1 and manhom = 6 or 7 then
chitra = tongchiphi*0.2
elseif noitru = 1 and tongchiphi >= 157500 and phantuyen = 2 or 3 or 4 then
chitra = tongchiphi*0.3
else
chitra = 0
end if
end sub
(như thế sai chổ nào nhờ các pro giúp đở)
Private Sub cmdtinhtien_Click()
if noitru = 1 and tongchiphi >= 157500 and phantuyen = 1 and manhom = 4 or 5 then
chitra = tongchiphi*0.05
elseif noitru = 1 and tongchiphi >= 157500 and phantuyen = 1 and manhom = 6 or 7 then
chitra = tongchiphi*0.2
elseif noitru = 1 and tongchiphi >= 157500 and phantuyen = 2 or 3 or 4 then
chitra = tongchiphi*0.3
else
chitra = 0
end if
end sub
(như thế sai chổ nào nhờ các pro giúp đở)