Comment by Seth Spearman on Access: Canceling Report generation causes error 2501
Answer by Seth Spearman for Access: Canceling Report generation causes error 2501
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.
Seth
Comment by Seth Spearman on Best practices in Access programming
get object out of telerik radcontrol for winforms binding
Hello,
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?
Seth
Tweets made on 2009-09-23
- Listening 2 #Econtalk while driving 2 work. #
- I am loving QueryExpress. http://digg.com/u1CzTB. 100K download and no installer. #
Powered by Twitter Tools.
Tweets made on 2009-09-23
- Listening 2 #Econtalk while driving 2 work. #
- I am loving QueryExpress. http://digg.com/u1CzTB. 100K download and no installer. #
Powered by Twitter Tools.
Is it true that I can still use Linq to SQL in design time even if you are targeting .net 2 in your application?
Hello,
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?
Thanks.
Seth
Answer by Seth Spearman for ms access reports and queries
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?
Seth
PS...BOMs display great in a treeview control.