Problems understanding syntax with multiple recordsets...

AB1984

New Member
Joined
May 12, 2016
Messages
17
Hi All,

I'm working on a VBA app written by a much more capable colleague and he isn't in today, without being condescending (please), could someone hazard a guess at what the following code is trying to do:
Code:
 If rs3(rs2(dataItem).Value) = rs2(dataValue) Or (IsNull(rs3(rs2(dataItem).Value)) And IsNull(rs2(dataValue))) Then
     b = True
 End If

rs3 and rs2 are recordsets, I know that much, and I understand that if the conditions are met then the variable b will be set to True, but I'm not too up on the syntax of using recordsets and it's a bit hard to work backwards.

Any guesses welcome :)
Cheers
 
Last edited:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
How are the recordsets related?
 
Upvote 0
In what way?
It's part of a reconciliation app. So rs3 are unmatched records from the input, and rs2 is a validations file that may or may not contain a matching value in a certain column (datavalue variable points to a column that has the identifier/field name, and dataitem points to the actual value that should be in both recordsets)...at least that's what I think is going on.

I suppose I really want to know what he means when puts:
Code:
rs3(rs2(dataItem).Value)

regardless of what the data actually means, would you be able to tell what this means? or would it depend on what rs3 has been set as?
 
Last edited:
Upvote 0
This,
Code:
rs3(rs2(dataItem).Value)
looks like it would return the value from a field in rs2 with the field name coming from a value in a record in rs3.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,095
Messages
6,128,792
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top