Solved

parameter queries using VBA

Posted on 1997-09-19
3
270 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

770 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