Delete record in continuous form

  • Thread starter Thread starter David
  • Start date Start date
D

David

Hi all, I am trying to delete a record in a continuous
form with no success. I have created a contionuous form
that is a sub-form on a main form. Wint in that continuous
formm I wanted to be able to delete a record if not
needed. I created a command button to delete the record
that it is tied to, or so I thought. Instead of deleteing
the record that the command button was on, it is deleteing
the first record. So,if I have record 1, 2 and 3 and I
don't need record 2 and click the cmd button to delete it,
Access is deleteing record 1. Any suggestions? Any help
will be appreciated.
Dave
 
Hi all, I am trying to delete a record in a continuous
form with no success. I have created a contionuous form
that is a sub-form on a main form. Wint in that continuous
formm I wanted to be able to delete a record if not
needed.

No button code is needed. Just be sure that the subform's "Record
Selectors" property is set to Yes; if it is (and if the Allow Deletes
is Yes and the form's recordsource is updateable) you can click the
grey bar at the left end of each record and click the Delete key.

You can use a command button, too - if that's easier for the users -
please post your code to see why it's not working in your case!
 
Here is what I am doing. I am using a label as my button.

Thanks for your help.

Private Sub Label4_Click()
DoCmd.RunCommand acCmdDeleteRecord
End Sub
 
Where is this label on your subform: in the subform's header? in the
subform's detail section? somewhere else?
 
The problem likely is that your label cannot accept the focus, so ACCESS
does not know that you're clicking the label on a different record. Hence,
it deletes the record that has the focus, which in your case seems to be the
first record.

Change the label to a command button and then you should be ok.
 
That was it. Thanks for your help.
-----Original Message-----
The problem likely is that your label cannot accept the focus, so ACCESS
does not know that you're clicking the label on a different record. Hence,
it deletes the record that has the focus, which in your case seems to be the
first record.

Change the label to a command button and then you should be ok.

--
Ken Snell
<MS ACCESS MVP>




.
 
Back
Top