deltagracesun
New member
- Local time
- Today, 16:35
- Joined
- Mar 27, 2012
- Messages
- 5
I have a pop up form that has the following SIMPLE code just to change the color of two fields based on the date.
If Me.[ExpDate] < Now() + 90 And Me.[ExpDate] > Now() Then
Me.[Training].BackColor = RGB(255, 255, 0)
Me.[ExpDate].BackColor = RGB(255, 255, 0)
ElseIf Me.[ExpDate] < Now() Then
Me.[Training].BackColor = RGB(255, 0, 0)
Me.[ExpDate].BackColor = RGB(255, 0, 0)
Else
Me.[Training].BackColor = vbWhite
Me.[ExpDate].BackColor = vbWhite
End If
This works perfectly... So, I can enter a record with only these two fields and the colors work as designed. The problem is when i go to delete a record, I get this Error 2424 (can't find field, control, or property). The error only occurs when in Form View. If I change the form to Datasheet view, I can delete without any error. The debug point is on the first line of the code. Is someone able to help here as I have spent a while on this doing research and haven't uncovered anything that I can use. Thanks.
If Me.[ExpDate] < Now() + 90 And Me.[ExpDate] > Now() Then
Me.[Training].BackColor = RGB(255, 255, 0)
Me.[ExpDate].BackColor = RGB(255, 255, 0)
ElseIf Me.[ExpDate] < Now() Then
Me.[Training].BackColor = RGB(255, 0, 0)
Me.[ExpDate].BackColor = RGB(255, 0, 0)
Else
Me.[Training].BackColor = vbWhite
Me.[ExpDate].BackColor = vbWhite
End If
This works perfectly... So, I can enter a record with only these two fields and the colors work as designed. The problem is when i go to delete a record, I get this Error 2424 (can't find field, control, or property). The error only occurs when in Form View. If I change the form to Datasheet view, I can delete without any error. The debug point is on the first line of the code. Is someone able to help here as I have spent a while on this doing research and haven't uncovered anything that I can use. Thanks.