Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21885

Need Help With If Then Statements

$
0
0
Hello all, I'm trying to create if then statements and can't quite get it.

I need to take two inputs from the user for the room type and the number of days the guest will be staying. Then I need to calculate that the room charge by the number of days and show it to the user.

This is what I have so far...

Sub IfStatement()

Dim getroom As String
Dim getdays As String

Const studiorate = 100
Const moderaterate = 125
Const deluxerate = 150


getroom = InputBox("What type of room would you like?")

getdays = InputBox("How many days will you be staying with us?")

If getroom = vbStudio Or vbStudio Then

MsgBox "Your total charge is & ' studiototal ' "

studiototal = studiorate * getdays


Else


MsgBox ("Please enter a valid room type.")

Exit Sub

End If

MsgBox ("Please enter a valid room type.")


End Sub

Viewing all articles
Browse latest Browse all 21885


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>