?
Solved

Access Delete with Pick List

Posted on 2009-04-28
3
Medium Priority
?
188 Views
Last Modified: 2012-05-06
In  Table A, I have a field, "States". (Table A has all 50 States) I will then be deleteing from Table A the States that have low incidences of breast cancer, from another Table B (obtained from public health site). Table B will be dynamic, and updated every month.

Rather than rewriting code, is it possible to use a Pick List where I can directly link Table A to Table B, and query to Delete any records in Table B that are also in Table B?

Hope this made sense.

Thanks.
0
Comment
Question by:tahirih
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
therealmongoose earned 2000 total points
ID: 24251967
How do you add records back in - why not just keep all states in table a and exclude states from table b using a left joined sql statement:
SELECT Table1.state, Table2.State
FROM Table1 LEFT JOIN Table2 ON Table1.state = Table2.State
WHERE (((Table2.State) Is Null));

Open in new window

0
 

Author Comment

by:tahirih
ID: 24252088
I did think about a Left Join, but prefer to delete the records from the original table.

The other option would be to create a new Table3 using INTO Tabe3.

Thanks.
0
 

Author Closing Comment

by:tahirih
ID: 31575522
Thanks.
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

862 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