Solved

Help with BindingNavigator - editing it's code

Posted on 2006-11-26
2
259 Views
Last Modified: 2013-12-25
hi, screw the ego, i need help.  :)

i've been trying for days to come up with a way to parse the child tables of an access relationship hierarchy using VB in VS2k5, and place the concatenated data in a single text box. below is the best i've been able to come up with but there's a minor problem with the event handler. the event below fires before the built-in 'next record' event in the binding navigator. i need the below event to fire after the bindingnavigator has advanced. or maybe i need to edit the event handlers of the bindingnavigator and add the following code to it? basically, what happens is the db advances a record and the text box shows data from the previous record. this is bad 'cause the user could potentially click the Add button to add the data to an existing record and end-up adding it to the wrong one.

any help would be SO appreciated. thanks.

    Private Sub BindingNavigator1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigator1.Click

        Dim drv As DataRowView
        Dim s As String = ""
       
        For Each drv In AddressesBindingSource
            s &= drv("Addr1").ToString() & "   "
            s &= drv("Addr2").ToString() & "   "
            s &= drv("city").ToString() & ControlChars.CrLf
        Next
        Textbox1.Text = s

    End Sub
0
Comment
Question by:zsoltib
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 18017478
what about using the event CurrentChanged of the Bindingsource:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.bindingsource.currentchanged.aspx

would be more generic than the click event of the navigator?
0
 

Author Comment

by:zsoltib
ID: 18017590
angelIII, you rock! just to clarify for someone else. i followed the concepts layed-out my MS in their article. however, in order to fix my problem i had to use the CurrentChanged event of a child table and not the parent.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now