setting focus to 3rd subform

S

sipiaolin

Now I am back to the original error: 2455 'You entered an expression that
has an invalid reference to the property form/report.'

Did I do the code right? Given your bang tip, this looks correct.

Me.Reservationfrm.Form.Jobfrm.Form.Invoicefrm.Form.AllowEdits = True
Me.Reservationfrm.Form.Jobfrm.Form.Invoicefrm.Form.AllowAdditions = True
Me.Reservationfrm.SetFocus
Me.Reservationfrm.Form.Jobfrm.SetFocus
Me.Reservationfrm.Form.Jobfrm.Form.Invoicefrm.SetFocus

Thanks again for helping me.


Pieter Wijnen said:
if you fire the sql the allowadditions will get bypassed
but you can also set
Me.Reservationfrm.Form.Jobfrm.Form.Invoicefrm.Form.AllowEdits = True
and
Me!Reservationfrm.Form.Jobfrm.Form.Invoicefrm.Form.AllowAdditions = True

HTH Pieter

Note: it is reccommended to use the . (dot) notation instead of ! (bang)
in
code, as it will at least throw an error at runtime.



redFred said:
Very good! But, I don't know how to ensure that I code properly to
ensure
the new record is allowed. Help?

:

think we solved it there

Pieter

Hmmmm....maybe you gave me a hint.

Jobfrm and its subform Invoicefrm are enabled and unlocked.
However --
maybe this? -- data entry is NO for Jobfrm and Invoicefrm.

This fails with 2105 "You can't go to specified record."
Me![Reservationfrm].SetFocus
Me![Reservationfrm].Form.Jobfrm.SetFocus
Me![Reservationfrm].Form.Jobfrm.Form.Invoicefrm.SetFocus

Hoping this sheds light, while I thank you for the help.
 

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

Similar Threads

Subform goes blank 1
Subform: record select form other subform 23
set focus 2
Error 2455 behaviour 3
tabbed subform related new record. 11
.Bookmark = .RecordsetClone.Bookmark 3
format combo box 6
Can't assign value 1

Top