-
Hello All.
I have a problem and I wonder if you folks can help me.
I have a PrintToExcel control I'm creating. I take the Control that is specified in the Program and Export its information to an Excel Spreadsheet.
Now I've got the Recordsets to work. But, I'm having trouble getting My OCX to recognize the other Controls. (I.e. Listview, Grid) I pass the name of the Control to my OCX as an object, because passing Listviews and Grids
as Listviews and Grids doesn't work, and when I try to change the Object back to a Control is gives me an Error ' Type Mismatch'.
Any help would be appreciated.
Thanks.
-Ray
-
It is impossible to pass a specific object like a Listview or a Grid as a general object, unless they are polymophic (derived from the same object.) Post some of your code so we can see what you are trying to do.
-
Control Problems
I have the End User set to a Control Property (ControlName) to the Control they want to print from, and set the type of control(PrintsFrom) it is. ( I.E. ControlName as Listview1, Printsfrom as ListView) Then I have the Usercontrol Click event Call a Function that checks for what kind of Control (I.e. Listview, Recordset) it is by reading Printsfrom and then Run the proper Print Function.
I do the Same with Recordsets except It's recordset Name and Printsfrom (RecorsdsetName as RS, PrintsFrom as Recordset.) And it works. If I can do it with Recordsets why can I do it with Controls?
I'm trying to get to the ParentControls collection and copy it into my Control, and try it from there.
I'm Missing Something.
Thanks for getting back to me.
-Ray