Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

locating and deleting records in tables.

Status
Not open for further replies.

kjspear

Programmer
Feb 13, 2002
173
US
Hello, I have set up a button with searches and deletes records that match a criteria. However, with TCursor, I can only delete the matching records on at a time by pressing the button. I

I would like to press the button only once and all the records that match the criteria all at one time.

How do I go about doing this?

Thanks
Kyle
 
The best way would be to use a delete query and a variable.

i.e.

Grab your variable from an unbound field, or picklist, or whatever. Then plug it into the delete query and run it.


var
MyVar string
qVar query
endvar

If someField.value = "" ; user types in criteria
then return ; don't want to delete ALL records - lol
else MyVar = someField.value ; variable assigned
endif

qVar =
Query

Table.DB | Computer |;only the field w/the Variable needed
Delete | ~MyVar |

EndQuery

if not qVar.executeQBE(":priv:deleted.db")
then errorShow()
endIf

----------------------------------------------

That's it.

Mac
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top