I am in the process of upgrading a client’s 2003 db to 2007 and whilst most of it works ok, I have an issue with a report that uses Public variables as part of the output.
2003 of course displays the values stored in the variables, but 2007 displays #Name?
The way the report works is the following code sets the variables from a form where the report is selected to run from:-
Private Sub Report_Open(Cancel As Integer)
dtmStartOfWeek = Form_frmWeeklyFeesSelection.txtFeesDate
curAdultGym = Form_frmWeeklyFeesSelection.txtAdultGym
curGymKids = Form_frmWeeklyFeesSelection.txtGymKids
curSpecialNeeds = Form_frmWeeklyFeesSelection.txtSpecialNeeds
lblDate.Caption = Format(dtmStartOfWeek, "dd/mm/yyyy")
DoCmd.Close acForm, "frmWeeklyFeesSelection"
And then fields within the report reference the variables. i.e. txtAdultGym =[curAdultGym]
The lblDate.Caption field does actually display the date, but the variables prefixed "cur" display the #Name? error. The variables are also used in other fields for calculation purposes which accordingly display the same error.
Would appreciate any advice anyone has.