Ditto to Phillipe's answer. you didn't give us the whole procedures but you need to do something like this...
Sub MyButton_Click On Error Goto myError DoCmd.OpenReport vBerichtName, nAnsicht MyExit: Exit Sub MyError: If Err.number = 2501 then goto myExit msgbox err.description goto myExit End Sub
This is a common error but you can catch it like any other error and ignore it if is 2501.
This article might help
I hope that someone can help me with an issue related to binding a bindable collection class to one of the Winforms Telerik list controls.
If you bind to a plain ole windows list control like this...
dim list as new listBox with list .DataSource=myCollectionClass 'this contains a collection of widgets. .ValueMember="WidgetID" .DisplayMember="WidgetName" end with
I can then get a widget out of the list by doing this...
Dim myWidget as Widget=ctype(list.Items(0),Widget)
If you do the exact same code with for example a Telerik RadListBox (same example as above) but change line one to be
Dim list as new RadListBox.
With RadControls it seems you cannot cast to the Object type directly. Whenever I try this I get the following error...
Unable to cast object of type 'Telerik.WinControls.UI.RadListBoxItem' to type 'Widget'.
Can someone at the least confirm that this is a known limitation of Telerik RadControls for Winforms or let me know the proper way to do it.
Thanks. Any help will be appreciated. Any thoughts?
Is it true that I can still use Linq to SQL in design time even if you are targeting .net 2 in your application?
Someone recently said that I can use Linq to SQL in my application even if I am targeting the .net 2 framework. Is that true?
How does that work? How do you setup your references? Any gotchas I need to be concerned about? Is there some special way to set that up?
To solve this problem in the past I would use a big temp table with fields like level1, level2, level3, etc. Level1, of course would where you would put the "root" objects...that is, objects that don't have a parent.
Then you create a function that calls itself recursively and fills out the table into all of the levels. It is sort of yucky but it works.
It has been a while since I did that ... I will see if I can find the function somewhere but I doubt I will be able to get my hands on it.
But I bet someone else has that code more available. Anyone? Anyone?
PS...BOMs display great in a treeview control.