Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete Master/Detail Records? (A2k (9.0.3821) SR-1)

    Delete Master/Detail Records?

    A2k (9.0.3821) SR-1

    I have Form (master record) with Sub Form (detail records) with referential integrity set on lngApplicantID both tables, no cascadeing selected.

    With a master record and detail record on the screen, I press the Delete button on the master record form I get the following message:

    Microsoft Access can

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Delete Master/Detail Records? (A2k (9.0.3821) SR-1)

    What is the code you have in the Delete button? That is what the error message is referring to.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Delete Master/Detail Records? (A2k (9.0.3821) SR-1)

    Hi Mark

    Here is the code:

    Thanks, John

    Dim msg As String
    msg = "You requested to Delete this Application and Permit Number: " & _
    Me!LastPermitNumber & " record on screen, click OK if this is what you want to do."
    If MsgBox(msg, vbOKCancel + vbExclamation + vbDefaultButton2, _
    "DELETE PERMIT NUMBER RECORD: " & Me!LastPermitNumber & "?") = vbOK Then
    DoCmd.SetWarnings False
    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
    DoCmd.SetWarnings True

    Dim strSQL As String
    strSQL = "SELECT * FROM tbl_HP_Applicant WHERE lngApplicantID = " _
    & GetPref("Default HP Permit Number")
    Me.RecordSource = strSQL
    ControlState ("Normal") ' Normal or Edit
    FormState ("Locked") ' Locked or Unlocked
    Else
    Me!cboLookupSequence.SetFocus
    End If

Posting Permissions

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