Solved

Help with BindingNavigator - editing it's code

Posted on 2006-11-26
2
246 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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

18 Experts available now in Live!

Get 1:1 Help Now