Hello all,
I have a table "LightDuty" with 2 fields: [L/D Start Date] and [1yr/+]
What I am trying to do is when the form loads, I want the [L/D Start Date] field date to be checked to see if it is >= to one year.
If it is >= one year then I would like to have an asterick placed in the [1yr/+] field.
This is what I have so far:
Unfortunately nothing is happening.
Oh, I have this code in my Form_Load Event
I have a table "LightDuty" with 2 fields: [L/D Start Date] and [1yr/+]
What I am trying to do is when the form loads, I want the [L/D Start Date] field date to be checked to see if it is >= to one year.
If it is >= one year then I would like to have an asterick placed in the [1yr/+] field.
This is what I have so far:
Code:
Dim db as DAO.Database
Dim rs as DAO.Recordset
With rs
If IsNull([1yr/+]) = True Then
If [L/D Start Date] = DateDiff('yyyy',[L/D Start Date], Now()) >=1 Then
Do Until .EOF
.Edit
.Fields([1yr/+]) = "*"
.Update
.Movenext
Loop
End if
Else
Exit Sub
End if
End With
rs.Close
Set db = Nothing
Set rs = Nothing
Unfortunately nothing is happening.
Oh, I have this code in my Form_Load Event