Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

change recordset

0 views
Skip to first unread message

J. Freed

unread,
Nov 7, 2007, 4:53:00 PM11/7/07
to
I've got a sub-form inside a form for which I want to change the recordset
from within VBA. (The sub-form has no recordset for itself and I wish to use
the same sub-form for several different queries, depending on which button is
pressed).

The line I currently am trying is

Me!pos_in.Recordset = "pos_same" where pos_in is the subform and "pos_name"
is the query I wish to use. The system rejects this line, but it likes

Me!pos_in.SourceObject = "pos_in_fimat"

which apparently changes the sub-form, not the recordset. How can I change
the recordset associated with that sub-form? TIA.....

Douglas J. Steele

unread,
Nov 7, 2007, 5:52:21 PM11/7/07
to
Try:

Me!pos_in.Form.Recordset = "pos_same"

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"J. Freed" <JFr...@discussions.microsoft.com> wrote in message
news:8AB48CEF-E17C-4F85...@microsoft.com...

John W. Vinson

unread,
Nov 7, 2007, 6:17:48 PM11/7/07
to
On Wed, 7 Nov 2007 13:53:00 -0800, J. Freed <JFr...@discussions.microsoft.com>
wrote:

I think you want

Me!pos_in.Form.Recordsource = "pos_name"

The Source Object is the name of a Form used within the subform control; that
Form has a Recordsource (not Recordset!) property which is the name of a
table, of a query, or is a SQL string.

John W. Vinson [MVP]

Marshall Barton

unread,
Nov 7, 2007, 7:08:43 PM11/7/07
to
J. Freed wrote:


Me!pos_in.Form.RecordSource = "pos_same"

--
Marsh
MVP [MS Access]

J. Freed

unread,
Nov 8, 2007, 4:28:04 PM11/8/07
to
That did the trick. Thanks!
0 new messages