Access 2003 change - no more subform.form property?

J

John Smith

Hi all,
I'm in the process of testing Acc2003 with my older Acc2K files, and I have
one fairly bizarre problem:

I've got an unbound form with two subforms placed on it. The top subform is
bound to one table and the bottom subform is bound to a related (1-to-many)
child table. I want the bottom subform to update to show all child records
related to the selected record in the top subform - as you pick something
new on top, the lower subform updates to show the related child records.
This works fine in 2000, with the lower subform's Linked Child Fields set to
the foreign key in the child table and Link Master Fields set to the primary
key in the upper subform. In the OnCurrent event of the upper subform, I
requery the lower subform's RecordSource.

Access 2003 ignores the requery completely. When I debugged, as I'm looking
at the subform object, it HAS a form property, but it's not attached to
anything so I can't update the lower subform's RecordSource. Anyone else
seen this kind of thing? I'm not seeing anything in the KB or on these
forums even remotely related.

Thanks in advance.
 
R

RSGinCA

When I debugged, as I'm looking
at the subform object, it HAS a form property, but it's not attached to
anything so I can't update the lower subform's RecordSource.

I think that form property IS the lower subform (or a reference to it), so you
can use a statement like the following:

Me.SubForm2.Form.RecordSource = "tblFred"

(SubForm2 = the name of the bottom subform control.)

Rick
 
J

John Smith

RS,
Thanks for the response.

That's the way you USED to be able to do it in 2000, but that's what I mean:
if you try that in 2003 it tells you that Form is an invalid property of the
subform, and examining the subform object in a watch window verifies that.
The ONLY properties you can get to are for the outer 'shell' of the subform:
you can see the LinkedChildFields and LinkedMasterFields properties but you
can't dig down into the underlying form via the FORM reference any longer.

Since nobody else has complained about this, I keep thinking I've got a
corrupted database, but it does it with two different files on four
different PCs. One of the databases is a split database with Access as both
front-end and back-end. The other database is an Access front-end and a SQL
Server 2000 back-end, if that makes any difference.

Thanks again.
 
R

RSGinCA

I was going to say that I have Access 2003 and it works fine for me, but....

I realized that that my little test was created with "Default File Format" set
to Access 2000. When I realized that, I 'converted' the database to Access
2002/2003 format. No problem! It worked fine. I was ready to write back
reporting my experience but I thought I ought to try a test using a db which
was originally created in Access 2002/2003 format. So I tried it, and...

It didn't work! So, the bottom line is that my experience seems to confirm
what you are saying: we USED to be able to do it, but now in Access 2003 (using
2002/2003 format) you can't. When I compile the VBA source code I get the
error message "Compile error: Method or data member not found".

If I get a chance, I'll look into it a little more. But at this point, it
doesn't appear that it is just you and your databases. (We must BOTH be crazy!)

Rick
 
R

RSGinCA

CORRECTION: It DID work when I coded it correctly. I was too quick with my
20002/2003 test program.

This didn't work: Me.SubForm2.RecordSource =

This did work: Me.SubForm2.Form.RecordSource =

So, it did always work for me in Access 2003 when I coded it correctly.

Rick
 
J

John Vinson

So, it did always work for me in Access 2003 when I coded it correctly.

<WHEW>!!!

That's a relief. I use that code a *lot* and would be aghast if it
were in fact lost.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top