Delete A Row From Table Based On Form Control Criteria (1 Viewer)

jleval

Registered User.
Local time
Today, 02:54
Joined
May 16, 2012
Messages
53
I have a form that is some how set to read only. It wont allow me to delete any records directly from the form.

What I would like to do is create a command button that deletes a row from the underlying table. I would like the row being deleted from the underlying table to be based on a control in the form.

I know the first response would be to figure out why I cant delete from the form, but I would really like to learn how to delete a row from the underlying table so that I can use it for other purposes.

NOTE: The PrimaryKey is a replication ID- Any way to get around the error that comes up on the findfirst method?

Any Ideas as to how I could do this?
 
Last edited:

PaulO

Registered User.
Local time
Today, 09:54
Joined
Oct 9, 2008
Messages
421
Build a DELETE Query off the Data TABLE, and BUILD the criteria in the unique field you wish to use as the record(s) identifier as [Form]![Field] where [Form]![Field] is the open form and field you are viewing

Attach this Query to a command BUTTON on the same form.

I use such queries all the time so, hopefully, this will work for you ...
 

Users who are viewing this thread

Top Bottom