Re: deleting records



hi,

how come that works, if i assign it to a double click, but not work if i
assign it to a delete button?

I still get that error sometimes.

i'm trying to get it to work with the delete button, as it makes more sense.
(if u know wat i mean).
u dont normally double click to delete somthing.

dev


"PC Datasheet" <nospam@xxxxxxxxxxx> wrote in message
news:v6JLf.3131$S25.2446@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
If your subform is a continuous form, all the fields in any row comprise a
record. You could put the code in the double click event of any field in a
row and when you double clicked on that field, the entire record would be
deleted. If your subform is a single form, all the fields you see in the
subform at any point in time comprise a record. You could put the code in
the double click event of any field in the subform and when you double
clicked on that field, the entire record would be deleted.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1125 users have come to me from the newsgroups requesting help
resource@xxxxxxxxxxxxxxx



"DP" <DP@xxxxxxxxxxx> wrote in message
news:g8GLf.35537$Fy4.23922@xxxxxxxxxxxxxxxxxxxxxxx
well yea, i have the main form open. it does not display the same
record,
but it does display the same membershipID which is in the subform.
(which
is
wat i;m trying to delete)

how would the code u gave me help? as u would have to double click each
field wouldnt u?

dev

"PC Datasheet" <nospam@xxxxxxxxxxx> wrote in message
news:jjpLf.2875$5M6.1878@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Error 3197 will occur if you have another form open that displays the
same
record. Do you have another form open?

An easier way to delete a record is to put the following code in the
double
click event of any field on your form:

DoCmd.SetWarnings False
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.SetWarnings True

--
PC Datasheet
Your Resource For Help With Access, Excel And Word
Applications
Over 1125 users have come to me from the newsgroups requesting
help
resource@xxxxxxxxxxxxxxx


"DP" <DP@xxxxxxxxxxx> wrote in message
news:eKnLf.15130$gB4.9220@xxxxxxxxxxxxxxxxxxxxxxx
hi,

i've got a form, with a subform in it. i've got a delete button in
the
subform. the code i;ve got is;

Private Sub cmdDeleteRecord_Click()

msg = "Are you sure you want to delete this film rental record?"
Style = vbYesNo + vbQuestion + vbDefaultButton2

Response = MsgBox(msg, Style, "Film Rental Database")
If Response = vbYes Then

DoCmd.RunSQL "UPDATE tblFilm SET tblFilm.Available =True WHERE
FilmID="
&
Me.FilmID

Recordset.Delete


Else
MsgBox "You cancelled the delete operation"

End If

End Sub

so when i lcick the delete button, i get the following error;


runtime error 3197

The Microsoft Jet Database Engine stopped becasue you and another
user
are
attempting to change the same data at the same time.


how can i overcome this error, as if i close the DB, and then open it
again,
it will delete the record, and update the correct field?? (currently
i
have
to press the delete button twice to delete a record)

thanx











.



Relevant Pages

  • Re: Using subforms
    ... Your Resource For Help With Access, Excel And Word Applications ... > fields in a subform. ...
    (microsoft.public.access.formscoding)
  • Re: Display Multiple Data Fields based on drop down selection
    ... Would I create the subform by using the query (which by the way you were ... How do I get the data from the query into the TeamMember table? ... have foreign-key fields that link to the Resource table (containing ...
    (microsoft.public.access.forms)
  • Re: Display Multiple Data Fields based on drop down selection
    ... "Peter" wrote: ... Would I create the subform by using the query (which by the way you were ... How do I get the data from the query into the TeamMember table? ... have foreign-key fields that link to the Resource table (containing ...
    (microsoft.public.access.forms)
  • Re: Subform email
    ... This works great for the email on the first record in the subform. ... make it populate the email of the resource in all the records on the subform? ... items on subform are Tasks assigned to a Resource with a DueDate. ...
    (microsoft.public.access.formscoding)
  • Display Multiple Data Fields based on drop down selection
    ... I've seen this done with a Classroom Database I downloaded from the ... Basically I want the user to be able to select the Resource Name from the ... Subform drop down field and have the DeskPhone, MobilePhone, SkypeName, ... if the user's DeskPhone needs to be changed, ...
    (microsoft.public.access.forms)