Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subform and allowadditions problem 1

Status
Not open for further replies.

paukste

IS-IT--Management
Nov 27, 2003
10
0
0
LT
Hi,
I have a form(“Invoice”) with a subform(“InvoiceLines”).
I cannot get what’s wrong. When I open a form from design view everything is ok but when I try to open the same form from another form clicking on command button I receive error:

Error: 2455 - You entered an expression that has an invalid reference to the property form/report

On form open event I have such code:

If IsNull(Me.invoice)=False then
Form_Invoice.InvoiceLines.AllowAdditions = False
End If
 
I've tried one more thing.
I've moved code to subform's on load event.

If IsNull(form_invoice.invoice)=False then me.form.AllowAdditions = False
End If

it works fine if it's (IsNull(form_invoice.invoice)=False) TRUE, otherwise I receive the same 2455 error.
 
Try:
If not IsNull(Me.invoice) then
me.InvoiceLines.form.AllowAdditions = False
End If

or simply
me.InvoiceLines.form.AllowAdditions = (not IsNull(Me.invoice))
 
paukste,
It's appropriate and customary to award a star to/thank a correct answer. This recognizes the member and marks the thread as successfully resolved.

Duane
Hook'D on Access
MS Access MVP
 
I'm new in participatin in a forum.
Thank you for remark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top