Solved

parameter queries using VBA

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
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…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

861 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