teresamichele
Registered User.
- Local time
- Today, 00:19
- Joined
- Oct 18, 2010
- Messages
- 13
I'm using Access 2007 and having a bit of a problem.
I have a form with a field for due date. I have an After Update event assigned to that to assign a priority code based on the distance from the current date to the due date. The priority code then appears in another box on the form.
The problem is that, of course, that priority code will change as the date gets closer to the due date but the reports I run will not automatically update the priority code if I simply link the result into the field on the report.
I've tried both using an IIf function as the control source for the Priority code on the report and using a piece of VBA "on load" for the report as a whole. Neither work, though, and I'm getting annoyed!
The VBA code I tried to use is:
Private Sub Report_Load()
Me.Priority = IIf([Me.FormEntry.DatePriority] < 30, "A", IIf([Me.FormEntry.DatePriority] < 60, "B", IIf([Me.FormEntry.DatePriority] < 90, "C", "D")))
End Sub
To which I get "Run-time error '2465': Microsoft Office Access can't find the field '|' refererred to in your expression. - but I have no idea what it's talking about.
I'm sure this is a user error but can someone help me?
I have a form with a field for due date. I have an After Update event assigned to that to assign a priority code based on the distance from the current date to the due date. The priority code then appears in another box on the form.
The problem is that, of course, that priority code will change as the date gets closer to the due date but the reports I run will not automatically update the priority code if I simply link the result into the field on the report.
I've tried both using an IIf function as the control source for the Priority code on the report and using a piece of VBA "on load" for the report as a whole. Neither work, though, and I'm getting annoyed!
The VBA code I tried to use is:
Private Sub Report_Load()
Me.Priority = IIf([Me.FormEntry.DatePriority] < 30, "A", IIf([Me.FormEntry.DatePriority] < 60, "B", IIf([Me.FormEntry.DatePriority] < 90, "C", "D")))
End Sub
To which I get "Run-time error '2465': Microsoft Office Access can't find the field '|' refererred to in your expression. - but I have no idea what it's talking about.
I'm sure this is a user error but can someone help me?
