Reputation: 21
recently i have been assigned a homework task to create any program i like with the use of polymorphism, inheritance etc so ive gotten pretty far with my application but ive come across an error which says :
Property Access Must Assign To The Property Or Use Its Value.
I personally have no idea what that means and ive attached some of my code where the error is constructing:
If rdbRed.Checked And rdbChequredBlack.Checked And rdbVision.Checked And rdbTinted.Checked Then
MiniCooperS.GetTotalCarPrice(MiniColour, MiniInterior, MiniPackages, MiniWindows)
Elseif...
so the error is showing somewhere within this code and ive been at it for hours and cant seem to figure it out.. Help is appreciated!!
THANKS!
Upvotes: 1
Views: 23283
Reputation: 51
If your getTotalCarPrice()
function returns a value (I'm assuming it returns an int or a String), you must assign that value to a variable. ie.
dim carPrice As Integer
If rdbRed.Checked And rdbChequredBlack.Checked And rdbVision.Checked And rdbTinted.Checked Then
carPrice = MiniCooperS.GetTotalCarPrice(MiniColour, MiniInterior, MiniPackages, MiniWindows)
Elseif...
Else carPrice = 0
Upvotes: 1