Hi
I'm quite new to programming vba in access, but I have two fields (txtDateFrom and txtDateTo) on a form. If the txtDateTo is empty, I just want to save the record to the table.
If there is a value in it, I want to save it and then create extra records for each day between the two dates (inclusive).
I have got as far as the code below, but don't really know where to go form here!
Thanks
Chris
Code:
Private Sub cmdAddLeave_Click()
DoCmd.RunCommand acCmdSaveRecord
If Not Len(Me.Me.txtDateTo & vbNullString) = 0 Then
For LeaveDate = Me.txtDateFrom.Value + 1 To Me.txtDateTo.Value
Next
Else
End Sub