First problem:
In the Command1_Click() subroutine, change it to something like the following:
Code:
Private Sub Command1_Click()
On Error Goto ErrorHandling
Dim loan As Double
Dim months As Double
Dim rate As Double
If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Then
MsgBox "please fill in all the details before proceeding"
Else
loan = Text1.Text
months = Text2.Text
rate = Text3.Text
Label1.Caption = Round(((rate / 1200) * (1 + (rate / 1200)) ^ months * loan) / (((1 + (rate / 1200)) ^ months) - 1), 2)
Label2.Caption = Round(Label1.Caption * months, 2)
Label6.Caption = "$"
Label7.Caption = ""
Label8.Caption = ""
End If
Call DrawGraph
Exit Sub
ErrorHandling:
Msgbox "The data you entered was invalid. Please correct this before re-calculating", vbInformation, "Invalid Data"
End Sub
The reason why your scrollbars are all screwy is cuz of this bit
Code:
Text2.Text = Text2 + scrollvalue
cant you see that your "Adding" the value of the text to the value of the scrollbar.
if you want it to start from say 300, just do this
Code:
Text2.Text = 300 + scrollvalue
Otherwise each time you click it it changes all weird...
3rd Problem. If you would like to change the label depending on an item selected in a combo box, you could do something like the following:
Code:
Private Sub Combo1_Click()
LabelObject.Caption = Combo1.Text
End Sub
Then when you calculate the weekly/monthly/etc payment you can assign the label to correct data by using a select case statement.
Code:
Select Case Combo1.Text
Case "weekly"
'Do whatever
Case "monthly"
'do whater"
End Select
About your intrinsic documentation, its ok for the decleration of the variables and the indenting. But even the objects should be given intrinsic identifers. A convention that is used in the labeling of objects followings something like the following:
cmdQuit (command button)
lblWelcome (label)
picGraph (picture box/picture)
mnuFile (menu)
txtName (text box)
Apart from using the three-letter abbreviation indicating the nature of the objects you should also give it a meaningful name (as shown above), rather than just label1, label2, label3. You might remember what they mean now, but for a person not-related to your project, it will be confusing to understand what the code means.
I think your project is pretty good overall. One thing you could fix however is by having capitialisation for the text within your project. You have everything all lower-case, and i guess it looks a bit lazy. Also for your combobox, you have it "style" property set to "0 - Dropdown combo", where combo refers to a comfbination input AND selection. I think for this case you only need selection (as entering anything else would probably be meaningless, and may cause errors) so you can change it's style to "2 - Dropdown list".