How to refer to a fieldname from a string

  • Thread starter Thread starter Jim Franklin
  • Start date Start date
J

Jim Franklin

Hi,

This is probably very simple but I cannot work it out. I have a table with a
number of fields, DD1, DD2, DD3 etc.

The code in my form finds a record in this recordset. I have a separate
numeric value (based on the number of days between two dates) which can vary
at anytime. I want to access the field which corresponds with the numeric
value and write its value elsewhere. For example, if my number of days = 7,
I want to get the value in field DD7.

Any idea how I do this?

Thanks to anyone who can help,
Jim F.
 
Assuming that rst is your recordset:

ValueFromField = rst.Fields("DD" & NumericVariableName).Value
 
Douglas J. Steele said:
Jeez, Ken, 'fess up. I've seen how slow a typist you are... <g, d & r>

--


OK - I actually traveled forward in time to find newsgroup questions, and
then I typed up the answers, and then I returned to my real time to await
the real posting of those questions, and then I immediately posted my
already typed answers so that I could appear to be a fast typist.....

< g >
 
Back
Top