Hello,
I writing a code that manages the deadlines of the files until now it was pretty simple they have only asked me to display the deadline of (n_file) one time after 10 days ( adddate to (reception_date)) and if = to date() the insertion is automatic in another table that contain ( N_file, deadline).
BUT yesterday I was asked:
while the (final_date) is empty the deadline date should be displayed every 10 days, and on top of that STAYING displayed for 5 days, HOW can i manage that seriously.
my code:
any idea?
I writing a code that manages the deadlines of the files until now it was pretty simple they have only asked me to display the deadline of (n_file) one time after 10 days ( adddate to (reception_date)) and if = to date() the insertion is automatic in another table that contain ( N_file, deadline).
BUT yesterday I was asked:
while the (final_date) is empty the deadline date should be displayed every 10 days, and on top of that STAYING displayed for 5 days, HOW can i manage that seriously.
my code:
Code:
Dim rsreg As ADODB.Recordset
Dim rsintregreg As ADODB.Recordset
Set con = CurrentProject.Connection
Set rsreg = New ADODB.Recordset
''
rsreg.Open "[TabInterval]", con, 1, 3
'
Do While rsreg.EOF = False
N_files= rsreg("n_files")
date_recp = rsreg("Date_Reception")
date_fina = rsreg("date_final")
If IsNull(date_fina) Then
date_recp = DateAdd("d", 10, [date_recp])
End If
rsreg("rap_reception") = date_recp
rsreg.MoveNext
Loop
'
Set rsreg = Nothing
GoTo Echenq
'req deadline date reg
Echenq:
Dim date_sys As Date
date_sys = Format(Now, "dd/mm/yyyy")
Dim ech As Date
Dim rsg As ADODB.Recordset
Dim rsp As ADODB.Recordset
'
Set rsg = New ADODB.Recordset
Set rsp = New ADODB.Recordset
rsg.Open "[TabIntervall]", con, 1, 3
rsp.Open "[not_Recep]", con, 1, 3
'DoCmd.RunSQL "drop table dbo.not_Recep"
sqlIntEch2 = "delete from dbo.not_Recep "
DoCmd.RunSQL sqlIntEch2
sqlIntEch3 = "delete from dbo.not_rep"
DoCmd.RunSQL sqlIntEch3
Do While rsg.EOF = False
date_rec = rsg("rap_reception")
N_files = rsg("n_files")
ech = date_rec
If ech = date_sys Then
rsp.AddNew
rsp("n_files") = n_doss
'rsp("Date_Ech") = ech
rsp.Update
rsp.MoveNext
End If
'Debug.Print ech, "___", n_doss
rsg.MoveNext
Loop
con.Close
Set con = Nothing
Set rsg = Nothing
Set rsp = Nothing
any idea?