Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Field Ref in Recordset (Access 2000)

    I know that a field named Data in recordset rst can be referenced in either of two way:

    rst.Data
    rst("Data")

    And I know that I could define a variable to contain the "Data" name and then refer to the variable in the second method. I also know that the 'rst' can be left off of the first method if a With rst block is used.

    Is it possible to use the second method in a With block? I haven't found any way to accomplish that without including the 'rst' which, it seems to me, tends to defeat the purpose of the With block.

    Thanks,
    Bill

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

    Re: Field Ref in Recordset (Access 2000)

    You can use

    .Fields("Data")

    in a With rst ... End With block, but that probably won't make you any happier...

  3. #3
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    874
    Thanks
    0
    Thanked 2 Times in 1 Post

    Re: Field Ref in Recordset (Access 2000)

    Now that you show me, I remember seeing that format before! I've normally not used the With block format in the past but I've read statements that say that using a With block executes more efficiently so I'm trying to switch to using that format more often and I ran into that dilemma immediately. I'll probably go ahead and use that .Fields("...") form.

    Thanks, Hans.
    Bill

Posting Permissions

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