Hi All,
Need clarification,
Actually I have a form where i have multiple textbox fields with the data type is date and the same is associated with a table.
but my concern is when u make chanegs in the 1st date field 2nd txtbox should calculate the second date (Eg: date2=date1+10)
when i did it using change event for the 1st txtbox its working fine with only 1st record of the database, when i move to the next record the same codes not working, why is it so..
below is the code what im using:
Private Sub FC1_Change()
Set db = CurrentDb
Set rs = db.OpenRecordset("tbl_Trans", dbOpenDynaset)
Pos = rs.AbsolutePosition
MsgBox Pos
Me.Dirty = False
For i = 2 To 8
rs.Edit
rs.Fields("FC" & i) = rs.Fields("FC" & i - 1) + rs.Fields("Pln" & i) - rs.Fields("Pln" & i - 1)
rs.Update
Next i
For i = 2 To 8
If Weekday(rs.Fields("FC" & i), 2) = 6 Then
rs.Edit
rs.Fields("FC" & i) = rs.Fields("FC" & i) + 2
rs.Update
ElseIf Weekday(rs.Fields("FC" & i), 2) = 7 Then
rs.Edit
rs.Fields("FC" & i) = rs.Fields("FC" & i) + 1
rs.Update
End If
Next i
Set rs = Nothing
Set db = Nothing
End Sub
Kindly do the needful.
Regards,
Prasanna R.D