Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating a field (with a space in its name) in an Access table

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
GB
I'm updating a field which has a sapce in its name. Great:

arecorset![a field]=astring

However, "a field" is not decided on at design-time but at run-time using a variable. How would I use a variable instead of "a field" so that it works even when the variable contains a space? Obviously "[a field]" is not a string to I cant concatenate:

"[" & thevariable & "]"

I've already tried that. Is it possible??

Thanks

elziko
 
Tricky question... :)

As far as I know you cannot do this. However, by determening the index of the field, you could address it that way:

rscmdUsers.Fields.Item(i).Name 'Do a loop, until you get to the field you want, then save i.
rscmdUsers.Fields.Item(i).Value= "Whatever you want."

Good Luck!
-Mats

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top