Hi everyone. I have a database of equipment owned by a company. Each piece of equipment needs to be inspected on a particular schedule, or frequency. I created a table called InspSched and placed monthly values in it - 3, 6, 12. Also added a drop-down combo box on the equipment detail form that pulls the schedule values from InspSched. The equipment detail form also has a text box called LastInsp.
Trying to use the DateAdd function to determine when something is due for inspection. I currently have this VBA code assigned to a button:
Private Sub DueDate_Click()
Dim N As Integer
Dim LastInsp As Date
N = InspComboBox.Value
LastDate = LastInsp.Value
DueDate = DateAdd("m", N, LastDate)
End Sub
This works, sorta. The Interval parameter is being assigned the value of the primary key of InspSched instead of the actual Schedule field value of 3, 6 or 12.
Any ideas?