Anne,
Do you not have enough room to put a delete button on the line in your
continuous form? I would strongly suggest you create a visible Delete Button
on the TransID line because that is the window standard. Double clicking on
something to delete it is NOT a window starndard. If I double clicked on
something, I would expect to "Open" the TransID detail. I would never ever
guess that double clicking it would delete it.
Now having stated the above, let me answer your questions. First, I'm
assuming that TransID is a text box control? If that is the case, you can
put the delete code in the double click event of the TransID.
If you don't know what code to write, you can use the system generated code
by creating a Delete Button on the same line on the continous form, then cut
that code and paste it in the double click event of the TransId control item.
If you want, you can create a Delete Button make it transparant and then lay
it over the TransId control. Since it is transparant, the delete button will
not appear it will be there. When people click or double click on the
TransID, the really will be clicking or double clicking on the delete button.
Here is come code that I'm developing, it is not complete but it is a start.
Code at top of form:
Const cintRunCmdCan As Integer = 91 ' Err # for Run
Cmd Cancelled err msg.
Const cintNoUndo As Integer = 2046 ' Err # for No
Undo Available
Const cintCouldNotFindObj As Integer = 3011 ' Err # for MS
Jet could not find object
Private Sub cbDelMem_Click()
On Error GoTo Err_cbDelMem_Click
If Me.Dirty Then
Me.Undo
End If
If Not Me.NewRecord Then
On Error Resume Next
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord
If Err.Number <> 0 And Err.Number <> cintCouldNotFindObj Then
GoTo Err_cbDelMem_Click
End If
End If
Exit_cbDelMem_Click:
Exit Sub
Err_cbDelMem_Click:
' If the Delete Command was cancelled, Access generates a RunCmdCancel
error message.
' We do not want to display this message, so we will not display the
RunCmdCancel message.
'
If Err.Number <> 0 And Err.Number <> cintRunCmdCan Then
Call BaseUtil.Dsp_Err_Msg(Err.Number, Err.Description,
"cbDelMem_Click")
End If
Resume Exit_cbDelMem_Click
End Sub