Access2002 .ADP "Run-time error 2455" -- "You entered an expression that has an invalid reference to the property Form/Report"

There's an unbound main form: frmDelivery, and an unbound subform: frmdeliveryItems.

The subform has a Public Sub, "ConnectSubform" that does the necessary binding.  The call from the mainform looks like this:

Private Sub ClearFields()
    txtDeliveryID = ""
    txtDeliveryTime = Now()
    cmbEmployee = ""
    cmbSupplier = 0
    Forms![frmDelivery]![frmDeliveryItemsSubform].Form.ConnectSubForm 0
End Sub

The name of the subform, and the name of the subform control on the main form are both:
frmDeliveryItemsSubform (name of control)
frmDeliveryItemsSubform (data: source object of control)

The Public routine in the subform looks like this:
Public Sub ConnectSubForm(intDeliveryId As Integer)
    Me.RecordSource = "spDeliveryItemsSubformRecordSource"
    Me.InputParameters = "@DeliveryID=" & intDeliveryId
    intDelivery = intDeliveryId
    Me.UniqueTable = "tblPurchaseOrderItems"
    On Error Resume Next
    intItemNo = txtDeliveryItemNo
End Sub

It's this line that causes the error:
Forms![frmDelivery]![frmDeliveryItemsSubform].Form.ConnectSubForm 0

... silly thing is, this has been working for the last 4 years... it only just stopped.  Is it co-incidence that I just upgraded to Access 2002?  The ADP is still in Access 2000 format.

I'm about ready to kill... been bashing my head against the wall for a week over this, so any/all help will be fallen on with whimpering gratitude!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Thandava VallepalliCommented:

Go through the links below,

All the best,
V.Thandava Krishna.
Thandava VallepalliCommented:
And this one also,

All the best,
V.Thandava Krishna.
Thandava VallepalliCommented:
And this one also,

All the best,
V.Thandava Krishna
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

JamesHardimanAuthor Commented:
Thanks for the pointers, V.Thandava Krishna, but I'd already surfed all of these, and they've got nothing to do with the problem.

I'm beginning to think this is an Access 2002 bug (feature?), because there are other "interesting effects" that have crept in since I installed 2002... see my next append (which I'm just about to make!)

James Hardiman
Does the error occurs on this line:

Forms![frmDelivery]![frmDeliveryItemsSubform].Form.ConnectSubForm 0

or is it somewhere in the Sub Procedure (ConnectSubForm). When debugging with F8 (Step Into) does it stop on this line, or goes it into this procedure until line ...?
JamesHardimanAuthor Commented:
Answer to wsteegmans ...

It stops on
Forms![frmDelivery]![frmDeliveryItemsSubform].Form.ConnectSubForm 0

and, when stepping on F8, does NOT gointo the ConnectForm routine.

I doen't know if this will work, but supposing that your Sub Procedure ClearFields is in your mainform [frmDelivery], try something like this for this line:
->      Forms![frmDelivery]![frmDeliveryItemsSubform].Form.ConnectSubForm 0

Replace it with
->      Me.frmDeliveryItemsSubform.Form.ConnectSubForm 0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hi JamesHardiman,

Please close or delete this question ...
Because it's solved ;-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.