Macro Help!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm a new user to Access with no programming experience and I need help with the following

what I want to do is

Find all records on table A & B that have a matching phone number with a record on Table C and I want to either a) delete the record or B) move the record to another table - whichever is easier

The additional issue I'm having is that the area code and phone number are 2 seperate fields (Columns

I have literally no programming experience....so this seemingly simple task is a chore for me. Hopefully, this is a breeze for you experts out there

Thanks in advance!
 
Assuming that you want to delete the records, when found, from Table A and
Table B, here are two sample delete queries that will get you started
(warning: always make a backup of your data before running a delete query in
case something goes wrong):

Delete query #1:

DELETE * FROM TableA
INNER JOIN TableC ON
(TableA.AreaCode & TableA.PhoneNumber) =
(TableC.AreaCode & TableC.PhoneNumber);



Delete query #2:

DELETE * FROM TableB
INNER JOIN TableC ON
(TableB.AreaCode & TableB.PhoneNumber) =
(TableC.AreaCode & TableC.PhoneNumber);

You can copy the statement for one of the delete queries into the ACCESS
query designer. Open a new query in design view, close the window that shows
you the choices for tables/queries, click on arrow next to icon in upper
left corner of toolbar and select SQL View, and then paste the statement
into the window that will appear (paste the statement over the top of the
text that will be in that window). Then you can switch back to design view
to see how the query looks in that view. Run the query by clicking on the
red exclamation point icon on the toolbar.
--
Ken Snell
<MS ACCESS MVP>

--
Ken Snell
<MS ACCESS MVP>

fred said:
I'm a new user to Access with no programming experience and I need help with the following:

what I want to do is:

Find all records on table A & B that have a matching phone number with a
record on Table C and I want to either a) delete the record or B) move the
record to another table - whichever is easier.
The additional issue I'm having is that the area code and phone number are 2 seperate fields (Columns)

I have literally no programming experience....so this seemingly simple
task is a chore for me. Hopefully, this is a breeze for you experts out
there!
 
Back
Top