Results 1 to 3 of 3

Thread: Getting Rid of a MsgBox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    ca, usa
    Posts
    91

    Post

    In VB5, I am using a data control along with a dbgrid, when I delete a row, I have it display a msgbox, but after my msgbox it displays another one saying
    "This Action was cancelled by an associated object." the code I am using is

    If vbKeyDelete Then
    If SSTab1.Caption = "Log Information" Then
    Msg = "Delete Row? (This Cannot Be Undone!)"
    Style = vbYesNo + vbCritical
    Title = "Remove Row"
    Ctxt = 1000
    Response = MsgBox(Msg, Style, Title, Help, Ctxt)
    End If
    End If
    If Response = vbNo Then
    Cancel = True
    End If


    How Can I remove the seconed msgbox?

    Thank you,
    Jeremy

    ------------------
    [email protected]

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Raleigh, NC
    Posts
    70

    Post

    Something else in your code is preventing the row from being deleted.... it doesn't really have anything to do with your confirmation code here. In fact, try commenting all of it out and confirm that you still get the error message. Then take a look at how you have things bound and perhaps your relationships.

    Bash

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    This, IMO, is one of the biggest problems with bound data controls. If a field returns an error, from the database, you don't know what caused it.

    "This Action was cancelled by an associated object." can be caused by a misspelt fieldname, locks being held on the field by another user, a data-type mismatch and just about any error condition you can think of.

    When I get them I usally convert what I've attempted to do to SQL and attempt a pass-through. In one of my programs, I've completely removed the code used for insert/update/deletes from my bound controls (leaving them to fetch data and populate formfields only)

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