Error 13: Type mismatch in VB

Asked By 0 points N/A Posted on -
qa-featured

I am making a hotel reservation form with a dropdown menu for the room type and price of the room per night.

I keep getting this error in Visual Basic when I click the button to compute for the total price:

"Error 13: Type mismatch"

I tried to take the value of a textbox and a drop down menu.

I want to get the total when the user selects the room and multiply it with the number of nights they input in the textbox.

SHARE
Best Answer by faisal_banker
Best Answer
Best Answer
Answered By 0 points N/A #83008

Error 13: Type mismatch in VB

qa-featured

Hi Bruce

I have read your query of having some trouble in visual basic when you want to calculate the total. I suggest you to do the following steps convert the data read from text boxes to numbers or you can use the Val function for its solution in the visuals basic as it calculates the sum for you.

so try to do the following function   VarCosts = Val(txtVC.Text)

Fixed Costs = Val(txtFC.T

Units Sold = Val(txtSold.Text

Unit Price = Val(txtPrice.Text)

Tot Costs = Val(txtTC.Text)  

Try to do this than let me know whether you get the results or not what you want thanks

Answered By 0 points N/A #83010

Error 13: Type mismatch in VB

qa-featured

Hi Bruce,

First, check that there are no inconsistencies between the data types you are using in your method call, and those that are specified in the method help.

You can access the help for any Measurement Studio control by selecting the control on the form and pressing F1.

Be sure to check the type of any output parameters that are set by the method.

You do not have to declare array variants with parentheses.

It is sufficient to declare the variable solely as Variant.

Related Questions