Results 1 to 4 of 4

Thread: Toolbar Actions [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539

    Toolbar Actions [RESOLVED]

    Hello everybody (hi DR NICK)

    OK i have main MDI PARENT with a toolbar on it

    i also have an mdi child with a paged view of a recordset (access db)

    I would like to have on my toolbar a button for "fIRST rECORD"
    a button for "NEXT RECORD", "Priv Record", "Last record"


    I have these buttons on the child and they work fine using this kinda code

    Me.BindingContext(DataSet11, "CustomerDetails").Position = 0

    that makes it go to the start of the recordset

    HOW CAN I MAKE MY TOOLBAR BUTTONS PERFORM THE SAME FUNCTION CONSIDERING ME.BINDINGcONTEXT & DATASET11 ARE NOT PART OF THE MAIN MDI PARENT ???????????????
    Last edited by carlblanchard; Nov 6th, 2003 at 11:34 AM.
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  2. #2
    Addicted Member Sheppe's Avatar
    Join Date
    Sep 2002
    Location
    Kelowna, BC
    Posts
    245
    Write a public sub in the child form that contains the code to move the position of the dataset. Call that sub from the toolbar's button click event.
    [vbcode]
    On Error Goto Hell
    [/vbcode]
    Sheppe Pharis, MCSD
    Check out http://www.vb-faq.com
    Click here for access to the free Code-Express source code and component sharing network for VB6
    Want a better way to skin your .NET applications? Click here!

  3. #3

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539
    code in my child

    Private Sub NavRecStart()
    Me.BindingContext(DataSet11, "CustomerDetails").Position = 0
    End Sub


    code in my parent

    frmCustomer_View.NavRecStart()

    get this message

    An unhandled exception of type 'System.NullReferenceException' occurred in ManageMyHosting.exe

    Additional information: Object reference not set to an instance of an object.
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  4. #4
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    In the click event of the toolbarbutton try this :

    VB Code:
    1. Dim F as frmCustomer_View = Me.ActiveMdiChild
    2. F.NavRecStart()
    3.  
    4. F=Nothing

    Then the same button should work no matter which child has the focus.

    Hope it helps.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width