Link to home
Start Free TrialLog in
Avatar of Digifx
Digifx

asked on

Access 02 to 07 upgrade -- Reports cannot get values from list view control

Yesterday we upgraded Access2002 to Access 2007.  The reports started asking for parameters.  I figured out that it will not get values from a listview  like [Forms]!Jobs!Jobs!SelectedItem.SubItems(3).  It will get parameters from textboxes like [Forms]!Jobs!JobSearchNum
The listview is an Active-X control  --MSComctlLib.ListViewCtrl.2
I could put textboxes on the form and move the data on SelectedItemChanged but I use a lot of data directly from the form.  Is there a fix for the report to get parameters from the listview?
 thanks for any help.
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image


  I haven't seen anything pop up on this.  Are you up to date on service packs for 2007?

JimD.

 and one other thing; the app compiles cleanly right?   Large number of issues with conversion from prior versions are caused by apps being converted in an un-compiled state.

JimD.
Avatar of Digifx
Digifx

ASKER

Yes it does compile.   Someone just told me to delete the control and place a new one.  Since it is active-x it might fix it.   I'll let you know.
Avatar of Digifx

ASKER

deleteing the listview control and re-creating it did not help.  Also I can type =[Forms]![Jobs]![Jobs].[SelectedItem].[SubItems](3)  in the intermediate widow and it displays the correct value.  When I put this in the contol source in a report textbox it displays #Name.   I'm losing hair quickly..... please help

 Make sure your using print preview of the report or print, not report view.  Lots of stuff doesn't work in Report View.

JimD.
ASKER CERTIFIED SOLUTION
Avatar of Digifx
Digifx

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for posting that.  I don't see anything wrong that you did though.

I do remember that other thread and it's in regards to form properties not being able to be read correctly.  I'll have to read it again, but at least you've found a work a round.

JimD.
Ah, here's the kicker:

"Before Access 2007, it was possible to reference public variables and properties of loaded forms directly, without wrapping them in a function. Wondering, why was it necessary to make that impossible, thus creating "second class" public properties and variables - now you can reference native public properties of forms etc., but not the ones you created. I think this moves away from what's called "object-oriented", and wrapping every public variable in separate function is counterproductive. This applies not only to the queries, but also to the forms, for instance, to the control source of a textbox."

  An active-x control would be considered to have custom properties as it's a non-native Access control.
Avatar of Digifx

ASKER

Changed how query references listview