Help with VBA syntax

shay

Registered User.
Local time
Today, 04:14
Joined
Apr 29, 2002
Messages
169
Hi all

I'm using Access to reformat some data - not what it's designed for I know but it's the only tool I have available at present.

Basically I need to be able to lookup a field name and write some data to it. I've attached the bit of code where it's falling over.

For ic = 1 To NoCols
FieldName = DLookup("[ColLetter]", "Columns", "[ColNumber]=" & ic)
MyRstOutput!FieldName = data(ic, ir)
Next ic

FieldName is a string which contains the name of the field I want to write to. I've guessed at [MyRstOutput!] & FieldName but that's wrong as well!

Any ideas, anyone?

TIA

shay
 
Forms("MyRstOutput").Controls(FieldName)
 

Users who are viewing this thread

Back
Top Bottom