simple syntax question

SunWuKung

Registered User.
Local time
Today, 07:30
Joined
Jun 21, 2001
Messages
172
Hi,
I am trying to read a value from code, but the field name would need to come from a variable. I don't seem to be able to find a way to have the variable (FieldName in this case) evaluated before it is executed. I am sure it is easy once you know how to do it...

Set rs = CurrentDb.OpenRecordset(SQLstring)
OrigPlace = rs!FieldName

Many thanks.
SWK
 
Hi SWK,

Change

OrigPlace = rs!FieldName

to

OrigPlace = rs (FieldName)

This is assuming that FieldName is a String data type.
 
Thanks Emohawk,

SWK
 

Users who are viewing this thread

Back
Top Bottom