3

I would appreciate any assistance. I am trying to access the value highlighted in my picture. The following do not work:

rs.items(1).value
rs.items(1).value(0)
rs.items(1).value(0).text
rs.items(1).value.value(0)

In some cases I receive "Type Mismatch". In some cases I receive "Wrong number of arguments or invalid property assignment"

Watch screenprint of "rs"

enter image description here

Thanks in advance!

braX
  • 11,506
  • 5
  • 20
  • 33
T. Boone
  • 31
  • 2
  • 1
    It's `Fields` not `Items`... – Erik A Mar 12 '19 at 13:45
  • Sorry I meant: rs.Fields(1).Value rs.Fields(1).Value(0) rs.Fields(1).Value(0).text rs.Fields(1).Value.Value(0) – T. Boone Mar 12 '19 at 16:41
  • You get "Type Mismatch" when the left hand side is not the same as right hand side. Since the right hand side is Variant/String, then the left hand side also needs to be Variant. If you can, go back to try the right hand side where you got Type Mismatch and use a proper left hand side. – donPablo Mar 12 '19 at 17:08
  • Is this a multi-valued field? [Not a good idea.](https://stackoverflow.com/questions/1461582/multivalued-fields-a-good-idea) – Andre Mar 12 '19 at 17:38
  • The left side is just a variable. I also see the same error if I attempt "? rs.fields.item(1.Value" in the Intermediate window. Also "? rs.fields(1).value(1)" in the Intermediate window produces the "Wrong number of arguments or invalid property assignment" response. The text within "Value(0)" is not multi-valued. It is a field in our Active Directory. – T. Boone Mar 12 '19 at 19:48
  • Did you find a way to access the value? Same issue here. – Al Grant Jun 05 '23 at 01:00

0 Answers0