run-time error 2455 - invalid reference to the property form/repor

D

deb

I get run-time error 2455 - invalid reference to the property form/report.
on the first IF portion.
The statement is on the Form_Unload

If ((Not IsNull
(Forms.fProject.f000Deliverable.Form.fTLNo.Form.f001WithinSiemens.Form.WSDateReceive)) Or _
(Not
IsNull(Forms.fProject.f000Deliverable.Form.fTLNo.Form.f002SiemensCustomer.Form.SCDateSent)))
And (Forms.fProject.f000Deliverable.Form.fTLNo.Form.TLNo = "TBD") Then
msg = "TL Number cannot be ""TBD"" if Sent or Received dates are
assigned." _
& vbCr & vbCr & "Select Ok to change TL Number" _
& vbCr & vbCr & "or Cancel to remove Sent/Received Dates in Within
Siemens and Siemens to Customer TABS."
ans = MsgBox(msg, vbOKCancel, "Attention")
If ans = vbOK Then
MsgBox "Please, enter correct TL Number."
Me.f000Deliverable.Form.fTLNo.Form.TLNo.SetFocus
Exit Sub
Else
MsgBox "If assigned, the Sent and Received Dates" _
& vbCr & vbCr & "on Within Siemens and Siemens to Customer TABS will
be removed.."

Me.f000Deliverable.Form.fTLNo.Form.f001WithinSiemens.Form.WSDateReceive = Null

Me.f000Deliverable.Form.fTLNo.Form.f002SiemensCustomer.Form.SCDateSent = Null
Exit Sub
End If
Else
End If

Please help...
 
M

mark

I get run-time error 2455 - invalid reference to the property form/report..
on the first IF portion.
The statement is on the  Form_Unload

If ((Not IsNull
(Forms.fProject.f000Deliverable.Form.fTLNo.Form.f001WithinSiemens.Form.WSDateReceive)) Or _
(Not
IsNull(Forms.fProject.f000Deliverable.Form.fTLNo.Form.f002SiemensCustomer..Form.SCDateSent)))
And (Forms.fProject.f000Deliverable.Form.fTLNo.Form.TLNo = "TBD") Then
        msg = "TL Number cannot be ""TBD"" if Sent or Received dates are
assigned." _
        & vbCr & vbCr & "Select Ok to change TL Number" _
        & vbCr & vbCr & "or Cancel to remove Sent/Received Dates in Within
Siemens and Siemens to Customer TABS."
        ans = MsgBox(msg, vbOKCancel, "Attention")
    If ans = vbOK Then
        MsgBox "Please, enter correct TL Number."
        Me.f000Deliverable.Form.fTLNo.Form.TLNo.SetFocus
        Exit Sub
    Else
        MsgBox "If assigned, the Sent and Received Dates" _
        & vbCr & vbCr & "on Within Siemens and Siemens to Customer TABS will
be removed.."

Me.f000Deliverable.Form.fTLNo.Form.f001WithinSiemens.Form.WSDateReceive = Null

Me.f000Deliverable.Form.fTLNo.Form.f002SiemensCustomer.Form.SCDateSent = Null
        Exit Sub
    End If
    Else
End If

Please help...

I wonder if its having a problem setting focus on the object "TLNo"
Try commenting out the line:
"Me.f000Deliverable.Form.fTLNo.Form.TLNo.SetFocus"
If the error goes away, then I would suggest Setting the Focus on
the subform first. Once the subform has the focus, then try
setting the focus on your field "TLNo".

Hope this helps... Mark
 
D

deb

I tried your suggestions and still got the error.
any other ideas? I can't figure this one out.
 
T

Tom Wickerath

Hi Deb,

I believe you have too much in your first two expressions. Also, try
changing the dots (periods) to bang (exclaimation marks). You may be able to
go back to the dot notation, but for now, I'd try the bang notation.

The general format should be:

[NameOfSubformObject].[Form]![NameOfControlInSubform].
or

[Forms]![NameOfParentForm]![NameOfSubformObject].[Form]![NameOfControlInSubform]

Try changing this:
(Forms.fProject.f000Deliverable.Form.fTLNo.Form.f001WithinSiemens.Form.WSDateReceive)

to this:
([Forms]![fProject]![f000Deliverable].[Form].WSDateReceive)

This assumes that the name of the control that contains the subform is
"f000Deliverable". This may or may not be the same name as the subform
itself. You may want to take a quick look at this article, which uses this
type of notation:

http://www.access.qbuilt.com/html/subtotals.html


Also, try changing this:
(Forms.fProject.f000Deliverable.Form.fTLNo.Form.f002SiemensCustomer.Form.SCDateSent)

to this:

([Forms]![fProject]![f000Deliverable].[Form].[SCDateSent])


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 
M

mark

I tried your suggestions and still got the error.
any other ideas?  I can't figure this one out.

I tried to mimic your forms and subforms.. this seemed to work for me:
Maybe trying referring to the controls similar to the following:

Me.f000Deliverable.Form!fTLNo.Form!
f001WithinSiemens.Form.WSDateReceive.Value

If that doesn't work, maybe double-check the actual subform CONTROL
names(not form names),
and make sure they are an exact match to the names you're
referencing.

HTH
Mark..
 

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