Solved

parameter queries using VBA

Posted on 1997-09-19
3
258 Views
Last Modified: 2006-11-17
I am trying to delete a set of records from a table using the following VBA, but it tells me to "specify the table containing the records I want to delete"...this also happens when I try to execute a normal query (without using VBA)

doCmd.RunSQL ("DELETE tblGrpDetails.dtlIDx, tblGrpDetails.dtlGroupLu, tblGrpDetails.dtlJobLu
FROM tblGrpDetails INNER JOIN TablesChosen ON tblGrpDetails.dtlJobLu = TablesChosen.TableName;
0
Comment
Question by:chapie
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
ozphil earned 50 total points
ID: 1956547
Try this
doCmd.RunSQL ("DELETE tblGrpDetails.*
FROM tblGrpDetails INNER JOIN TablesChosen ON tblGrpDetails.dtlJobLu = TablesChosen.TableName;

And in design view drag the asterisk from the field name list of the table whose records you wish to delete into the grid
0
 
LVL 3

Author Comment

by:chapie
ID: 1956548
don't know how that would work, I'll try at the office on Monday.

I don't know if you caught it but my topic/title had nothing to do with the question, that's because I was going to ask another question, but changed and forgot to change the topic.

Anyway, my point is that I fixed not only the origional problem, but because that problem was fixed I solved this problem but not needing to delete a join query, because I pass each record to the parameter query.  If you're interested I'll post the code how I did it, I don't know if you are familiar with using VBA w/ parameter queries, I had a tough couple of days trouble shooting this one.
0
 
LVL 4

Expert Comment

by:ozphil
ID: 1956549
I wondered about the question title, but concentrated on the actual question.

I have used VBA with parameter queries extensively.

Thanks Chapie
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now