Re: Using Variables to Reference a Field Name

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"=?Utf-8?B?Qk9CSg==?=" <BOBJ@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
news:CD935293-BB1B-40A8-AA5B-F2DBFBC3F647@xxxxxxxxxxxxx:

> I'm trying to use a de-referenced variable to access a field name.
> For example, if I have several fields named sequentially F1, F2, F3,
> F4, etc...

.... then you have a big Design Problem...

> and I want to programmatically construct the field name to
> reference these fields with a variable for the numeric part of the
> field name in a recordset, how would I accomplish this?
>
> Looking for something like:
>
> NewVar = Recset!F[i]

NewVar = Recset.Fields("F" & format(i,"0"))


.... but seriously, I would look at either reconstructing this thing into
a database or using a spreadsheet app.

Best wishes


Tim F
.



Relevant Pages