Kodlar altforma eklenecek
Private Sub Form_Open(Cancel As Integer)
Dim ctl As Control
For Each ctl In Me
If ctl.Name Like "Senet Tarihi_*" Then ctl.OnExit = "=TrkKont([" & ctl.Name & "])"
Next ctl
End Sub
Function TrkKont(ByRef ctl As Control)
xCtlNum = Mid(ctl.Name, 14)
If xCtlNum > 1 Then
If ctl.Value <= Controls("Senet Tarihi_" & xCtlNum - 1).Value Then
MsgBox ctl.Value & " tarihi " & Controls("Senet Tarihi_" & xCtlNum - 1).Value & "tarihinden küçük/eşit olamaz"
ctl.Value = Null
ctl.SetFocus
End If
End If
If xCtlNum < 10 Then
If ctl.Value >= Controls("Senet Tarihi_" & xCtlNum + 1).Value Then
MsgBox ctl.Value & " tarihi " & Controls("Senet Tarihi_" & xCtlNum + 1).Value & "tarihinden büyük/eşit olamaz"
ctl.Value = Null
ctl.SetFocus
End If
End If
End Function