I'm currently working on a project which acts in a similar fasion to the "Build Your Car Online" programs, only on one page. I want the program to access a sub procedure which adds values based on which set of option buttons were clicked (Each set (Color, Car, Two/Four Door) has their own frame). Whenever I click the command button however, I get an error message stating "Compile Error ByRef arguement type mismatch". Also, the values aren't adding up at the end of the program. I'm terrible at writing code so for all I know, this is nearly all wrong. Thanks for your time and help.
Private Sub Command1_Click() Dim car, color, door As String, cost, cost1, cost2, cost3 As Single Call showcost(color, cost1, cost2, car, door) MsgBox "You have selected a " & color & door & car & "Costing: $" & cost1 + cost2 & "." Public Sub showcost(color, car, door As String, cost1, cost2 As Single) If optFocus.Value = True Then car = "Focus" cost1 = cost + 16500 ElseIf optFusion.Value = True Then car = "Fusion" cost1 = cost + 16000 ElseIf optTaurus.Value = True Then car = "Taurus" cost1 = cost + 15500 End If If optRed.Value = True Then color = "Red, " ElseIf optBlue.Value = True Then color = "Blue, " ElseIf optBlack.Value = True Then color = "Black, " ElseIf optWhite.Value = True Then color = "White, " End If If optTWoDoor.Value = True Then door = "two door, " ElseIf optFourDoor.Value = True Then door = "four door, " If chkHeat.Value = True Then cost2 = cost + 1000 ElseIf chkLeather.Value = True Then cost2 = cost + 600 End If End Sub End Sub