View Full Version : Interest Calculation Problems


jmkct
12-13-2000, 07:25 AM
I am trying to set up VBA code to populate a field with interest based on data previously input to the same form/table. There are two fields for the value date and maturity date (both set as medium date format) that are included in the calculation. I can get the formulas to calculate yearly interest - but when I attempt to subtract the maturity date from the value date (*.value = [Mdate] - [Vdate]) - I get error 438 "object doesn't support this property or method". Any ideas? I've tried using datevalue to no avail. I'm guessing that I'm overlooking something very basic here.

Regards, JMK

simongallop
12-13-2000, 08:01 AM
Not 100% sure where you are getting your dates from. The attached code is using user input into 2 textboxes and posting the result into a third textbox, when the user clicks a button.

Dim StartDate As Date, EndDate As Date
Private Sub cmdCalc_Click()
StartDate = Me.txtStart
EndDate = Me.txtEnd
Me.txtDiff = EndDate - StartDate
End Sub


If you do use the above code I would suggest that you test that the data entered by the user is a valid date and that the end date is after the start date.

HTH