Lyle,
The Main form does not have a recordset to filter.
Sure I use some queries to populate comboboxes, but the main form
is essentially unbound. Also your code does not attach the recordset
you created to the subform...which was the essence of my original question.
The original posting works just fine for a mainform but doesn't work
for a subform. Why? Is there something I am missing?
I am still puzzled about this.
Any other ideas?
Thanks again,
IanO
[color=blue][color=green]
> > in posting
> >
http://groups.google.com/groups?hl=e...w=1&selm=bmEK9
> > .43452%24lj.1060600%40read1.cgocable.net Lyle showed us that an
> > ADODB.Recordset can be created and attached to a continuous (and
> > datasheet) form.[/color][/color]
[color=blue]
> Hmmmm ... I would probably do this from the main form with this code to
> filter the pseudo sub form "Form1"
>
> Option Compare Database
> Dim r As ADODB.Recordset
>
> Private Sub Form_Current()
> With r
> .Filter = adFilterNone
> .Filter = "fldVirtual = '" & Me.fldVirtual & "'"
> End With
> With Form_Form1
> Set .Recordset = r
> End With
> End Sub
>
> Private Sub Form_Open(Cancel As Integer)
> Set r = New ADODB.Recordset
> With r
> .CursorLocation = adUseClient
> .CursorType = adOpenKeyset
> .LockType = adLockOptimistic
> .Fields.Append "fldVirtual", adChar, 255
> .Open
> .AddNew
> .Collect(0) = "Malcolm"
> .Update
> .AddNew
> .Collect(0) = "Keith"
> .Update
> .AddNew
> .Collect(0) = "Lyle"
> .Update
> .MoveFirst
> End With
> End Sub[/color]