Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello! ok so I'm doing this project and it require the if then elseif. my question is assume that I have two groupbox. user must select one of the radio button from each groupbox. One of the groupbox is type of car and the other is gas option.
so the user choose a honda from type of car and prepay from gas option. once selected, this command will happen.
decTotalCostOfRent = honda rend price + prepay price
I guess my question is how do I tackle this problem.
this is what I have so far and it work but
unfortunately I have three type of car and it won't work.please help.
If Me.radJeepWrangler.Checked And radPrepay.Checked Then
decCostPerDay = decJeepWrangler + decPrePayElseIf radJeepWrangler.Checked And radSelfPaying.Checked Then
decCostPerDay = decJeepWrangler + decSelfPay
End If

Let me get this straight, it works for one type of car but not for the others? I might be able to help you considering I'm currently doing the exact same project for my class. also would it be possible to post some more information? like what will these fomulas be calculating?

ok i figure it out! here is the code to get you started if you have some difficult doing the homework yourself.
If IsNumeric(Me.txtNumberOfDayRent.Text) Then decNumberOfDayRend = Convert.ToDecimal(Me.txtNumberOfDayRent.Text)
If decNumberOfDayRend > 0 And decNumberOfDayRend < 8 Then
If Me.radJeepWrangler.Checked And radPrepay.Checked And radMultipleDriver.Checked Then
decCostPerDay = decJeepWrangler + decPrePay + decMultipleDriver
ElseIf radJeepWrangler.Checked And radSelfPaying.Checked And radMultipleDriver.Checked Then
decCostPerDay = decJeepWrangler + decSelfPay + decMultipleDriver
ElseIf radJeepWrangler.Checked And radSelfPaying.Checked Then
decCostPerDay = decJeepWrangler + decSelfPay
ElseIf radJeepWrangler.Checked And radPrepay.Checked Then
decCostPerDay = decJeepWrangler + decPrePay

![]() |
Real VNC (Unlock Remote P...
|
Set PID in Tasklist as Va...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |