Update all records in VBA

G

Guest

I have a form frmParts with record source tblParts. In frmParts, I'm using
the macro action setvalue to set the value of many fields in my form, which
are then stored in tblParts. The setvalues expression is a dlookup looking at
fields in other tables in my database, tblA and tblB, which I haven't been
able to successful relate with tblParts.

My question is: tblA and tblB are often updated through importing. I'm
doing the import and update tblA and tblB in VBA. Is there a way, in VBA
where, after I import a new tblA or tblB, that I can run through all the
records in my tblParts and update the fields that were originally populated
using the macro action setvalue when the form/record was open? Thank you
very much.
 
S

SA

Alex:

1.) First, it would be easier and faster to do the update using an update
query rather than using VBA.
2.) That said, the challenge will be that what you need is a cross walk
table that takes old or prior values from the tblA and tblB and then maps
them to the new values you are importing; but it appears that you are wiping
them out with the import and overwrite. If that's not the case, (i.e.
there's still some unique ID that is consistant in tblA and tblB after the
update that is also contained in tblParts, then the update should be simple
using the query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top