Hello,

I am a novice Access 2002 user and I'd like to delete all rows where the "category" fields says "buyer" as I do not need this information in my Real Estate database.

For example, I tried setting a query in SQL view with these parameters:

DELETE FROM [dbRealEstate] WHERE [dbRealEstate].Category ="buyer"

But since this is a command and not really a query, I am wondering where to do this. I also am seeing people writing VBScript into Access, but am wondering where I can do this. I have extensive experience with VBScript but it has been several years since I've used it and I haven't ever paired it with Access.

Thank you,
Eric

Recommended Answers

All 5 Replies

yeah, you could use VBA (basically VB6 but in access) or maybe a macro?

Where do I enter a macro or use VBA?

tools -> macro -> visual basic editor

or right click on a command button on a form and choose code builder if you want to do it that way

On the main access menu, choose queries/new/design view... when the query design window opens - the "SELECT TABLES" window appears - click CLOSE. The top line display changes. Click on the "SQL" item in the top row. You can enter your "command" (sql text) there. Then click on the "RED EXCLAMATION POINT" -- when means "RUN" ... that's all there is too it.

... or use design view. Select the table name from the SHOW TABLE list. Double left click on the field name CATEGORY. On the CRITERIA line under that field, type "buyer". Choose query type = Delete ... (look at buttons on top row)... This process writes the sql statment for you with correct syntax.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.