Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Help with BindingNavigator - editing it's code

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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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

782 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