Recordset based on subset of columns of another recordset
Posted on 2009-02-09
I'm only just learning about vba and recordsets so I don't know if I'm looking at this in the right way. All help appreciated.
I've got two forms:
FormA has 20 data fields
FormB has a list box showing 2 of the data fields from FormA
I want to synchronise the Form B list box with the recordsource of FormA, which will change when filters are applied to it. I have achieved this quite simply with:
Set Forms!FormB.lstBox.Recordset = Me.Recordset
However, the application will end up running against tables on Oracle server and want to maximise speed and efficiency, as well as requiring only 2 columns from 20 for the list box.
I know I could create a new recordset based on an SQL statement to select just the columns I want from the base table, but I assume that would call the server again. Given that I've already got the FormA recordset loaded, is there any way I can take just 2 columns from it to poke at the listbox?