Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Event Handler doesnt execute all of its code

Status
Not open for further replies.

daedelous

Technical User
Mar 30, 2004
8
NO
Hi again..yet another question about event handling.

This is my code:
Private Sub Canvas_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.fyllDataset()
InitiateWindows()
FormDisplay.Show()
AddHandler DsData1.Kommentar.RowChanged, New DataRowChangeEventHandler(AddressOf Kommentarrow_Changed)
End Sub

Private Shared Sub Kommentarrow_Changed(ByVal sender As Object, ByVal args As DataRowChangeEventArgs)
MsgBox("Event caught")
MsgBox("Event caught")
Canvas.OMG()
End Sub

Friend Shared Sub OMG()
Dim dw As DataView
dw.Table = refhoved.DsData1.Kommentar
dw.RowFilter = "BehandletDato = 'Nei'"
MsgBox(dw.Count.ToString)
End Sub

The problem is as follows. When I do changes to my datagrid which is bound to the dsData1.Kommentar table, the event kicks in and displays the first 2 messageboxes just fine, but when it is supposed to go on to the next line and call the OMG procedure, absolutely nothing happens. The program doesnt hang, but nothing happes as if the code ended with the first 2 msgboxes. I wish to manipulate a listbox on a different mdi child form through this event, but can't seem to get it running :(

Thanks for reading
 
Hi all.

I figured it out. Had forgotten "as new" in a line. Sorry for wasting ur time.



That's what I get for progging long into the nightly hours I guess..another 2 hours wasted :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top