Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Help with BindingNavigator - editing it's code

Posted on 2006-11-26
2
Medium Priority
?
323 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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

721 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