Re: VBA/Access Global Search&Replace from LUT
- From: "simon.robin.jackson@xxxxxxxxx" <simon.robin.jackson@xxxxxxxxx>
- Date: Thu, 29 May 2008 12:00:47 -0700 (PDT)
I have no control over the database structure - its a clients and I
cant really mess with it, I just need to be able to
Find and replace data across multiple tables.
I thought id be able to do this with one update query, but like you
mention...
With your structure you will need 30 update queries, one for each table. The
only VBA required would be to run each of the 30 queries. This of would need
to be run inside a transaction so if one failed no changes would be saved.
Didnt really fancy setting up loads of queries - Because each table
has three or so fields within it that need checking for old ID values
and replacing with new ID values. Therefore each table itself may
need 3 separate update queries, 30 table = lots of time consuming
queries. Id like to leave this as a last resort.
There is no find and replace feature for data in multiple tables. You could
code some VBA to open 31 record sets to do the lookup and edit, but that can
be very slow running and pron to error.
I have found snippet of code that finds and replaces, but I need to
automate
Opening a target table, opening the Look Up Table, loop through the
Look Up Table to feed into the S&R function the Old And New IDs, then
move onto the next record until its finished. Then move onto the next
table.
I imagine this may take awhile but the tables contain around 7000
records each, so memory shouldnt be an issue and not fussed about time
as long as it works.
Manually, if I select everything in a table and S&R, it seems to be
pretty quick and cant imagine there being any errors.
What are the 30 tables? Your current structure allows one upstream and one
downstream? What happens if a river has 2 upstream; add a 2nd upstream ID
and Name then edit your update loop? Lookup normalization, it will help you
in the long run.
Good points - strengthens the case to come up with some VBA code to
S&R?
Thanks for your help so far, please dont leave me!
.
- Follow-Ups:
- Re: VBA/Access Global Search&Replace from LUT
- From: paii, Ron
- Re: VBA/Access Global Search&Replace from LUT
- References:
- VBA/Access Global Search&Replace from LUT
- From: simon.robin.jackson@xxxxxxxxx
- Re: VBA/Access Global Search&Replace from LUT
- From: paii, Ron
- Re: VBA/Access Global Search&Replace from LUT
- From: simon.robin.jackson@xxxxxxxxx
- Re: VBA/Access Global Search&Replace from LUT
- From: paii, Ron
- VBA/Access Global Search&Replace from LUT
- Prev by Date: Re: VBA/Access Global Search&Replace from LUT
- Next by Date: Re: Opening Excel from Access
- Previous by thread: Re: VBA/Access Global Search&Replace from LUT
- Next by thread: Re: VBA/Access Global Search&Replace from LUT
- Index(es):
Relevant Pages
|