Solved

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

Posted on 2003-11-17
11
1,306 Views
Last Modified: 2007-12-19
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
    txtDeliveryTime.SetFocus
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.Requery
    Me.UniqueTable = "tblPurchaseOrderItems"
    On Error Resume Next
    Me.Recordset.MoveLast
    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!
0
Comment
Question by:JamesHardiman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
11 Comments
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 9763055
Hello,

Go through the links below,

http://beta.experts-exchange.com/Databases/MS_Access/Q_20389444.html
http://dbforums.com/t585227.html

All the best,
V.Thandava Krishna.
0
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 9763077
And this one also,

http://www.utteraccess.com/forums/access/access241952.html

All the best,
V.Thandava Krishna.
0
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 9763201
And this one also,

http://www.orlofsky.com/help_desk.htm
http://www.orlofsky.com/help_desk.htm#who

All the best,
V.Thandava Krishna
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:JamesHardiman
ID: 9763233
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
jamesh@sunsail.com
0
 
LVL 7

Expert Comment

by:wsteegmans
ID: 9764693
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 ...?
0
 

Author Comment

by:JamesHardiman
ID: 9764749
Answer to wsteegmans ...

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

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

James
0
 
LVL 7

Accepted Solution

by:
wsteegmans earned 500 total points
ID: 9765040
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
0
 
LVL 7

Expert Comment

by:wsteegmans
ID: 9791529
Hi JamesHardiman,

Please close or delete this question ...
Because it's solved ;-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
In this post we will learn different types of Android Layout and some basics of an Android App.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question