Results 1 to 3 of 3
  1. #1
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Recordset .Update question (A2003)

    I need to edit and update the values in a recordset, such as,

    With rst
    .edit
    ![F8] = CalculatedNumber
    .Update
    End with

    However, I need to base the field name on a variable such as FX where X = 8.

    Can ![F8] be replaced with ![F & X] or other nomenclature such that it equates to F8 and works. I have tried every combination I can think of but can't get this to work. It does work fine if I use ![F8].
    Regards,

    Gary
    (It's been a while!)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Recordset .Update question (A2003)

    Use
    <code>
    .Fields("F" & X) = CalculatedNumber
    </code>
    As far as I know, you cannot use a variable within the [F8] notation. [F8] is shorthand for Fields("F8") and this lends itself to concatenating string values.

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Recordset .Update question (A2003)

    Thanks Hans,

    <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>
    Regards,

    Gary
    (It's been a while!)

Posting Permissions

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