Solved

Help with BindingNavigator - editing it's code

Posted on 2006-11-26
2
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

623 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