Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    15

    Question Unanswered: variable names defined by variables - is this possible ?

    I am trying to the following :

    Code:
    strFieldName = "SomeFieldName"
    strNaam = "Something"
    
    rs![strFieldName] = strNaam
    rs is a recordset and strFieldName is a variable containing the name of the field I want to change. I should be writing the field name here but I want to use a variable containing the field name to be able to generalize the code a little more.

    Is this possible ? (and how should I do this )

    Wouter

  2. #2
    Join Date
    Mar 2005
    Posts
    261
    rs.Fields(strFieldName) or rs(strFieldName) for short.

    Wayne Phillips
    http://www.everythingaccess.com

  3. #3
    Join Date
    Oct 2005
    Posts
    15
    So damn simple and still I couldn't find the answer myself !

    tnx, Wouter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •