Updating from a table where the filed name comes from the table

C

Chris Reveille

I have a table that was created from and audit routine. When a client
updates a form the changed fields are written to a table like below
EditRecordId EditDate User RecordId SourceTable SourceField BeforeValue AfterValue
51456 8/4/2008 10:15:11 AM jjj 1210703432 Client_Info Address1 888888888
3038 Arlington Avenue 99999998 3038 Arlington Avenue
51457 8/4/2008 10:21:16
AM jjj 1210703432 Client_Info City Pittsburgh 2222222Pittsburgh
51458 8/4/2008 10:21:44 AM jjj 2057801654 Client_Info State PA AR
51459 8/4/2008 10:21:44 AM jjj 2057801654 Client_Info County Null Bedford

Sorry for the word wrap
In the above example the fields needing updating are City, State County. Is
there a way by writing one query/piece of code that will update the field
that is in the column?

Thanks
Jim
 
L

Larry Linson

Relying on an example is not a good way to transmit debugging information,
and relying on multiple lines to be properly formatted in a newsgroup post
is even worse. Tell us what information you have, in sufficient detail that
we can understand it, and perhaps someone can give you a worthwhile answer.
Most here do not have time and energy to try to dig your information out of
the conglomeration of text and numbers resulting from the line wrap, for
which you apologized, but made no effort to "fix".

In general however, you can, from VBA DAO code, specify the Field in a
record using its name as

Dim rs as DAO.Recordset
 

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

Top