Hello, I want to call a certain function, after 6 months, or 12 months, or 18 months; how can I do this
F. T. W.
Printable View
Hello, I want to call a certain function, after 6 months, or 12 months, or 18 months; how can I do this
F. T. W.
option Explicit
private Sub Form_Load()
Dim dToday as date
Dim dLastDay as date
Dim lDiff as Long
dToday = Now()
dLastDay = GetSetting(App.Title, "Settings", "SaveDate", Now())
lDiff = DateDiff("M", dLastDay, dToday)
If lDiff >= 6 then
'Do your function here
'Save new date in Reg.
SaveSetting App.Title, "Settings", "SaveDate", Now()
End If
End Sub
I've got this form connected to a DB through ADO code. The problem is that I want to change and update the recordset, for each record in 6 Months time, how can I save the date for each record to the registry, orwhat else can I do¿
F. T. W.
Hi,
It is better to create a table for the date. and verify it whether u have completed 6 months or not.If so then u call ur function and update the date in the data base.
Have a nice time
sunil.