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
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
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
It's this line that causes the error:
... 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!