A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

setting focus to 3rd subform



 
 
Thread Tools Display Modes
  #1  
Old September 25th, 2007, 03:34 PM posted to microsoft.public.access
redFred
external usenet poster
 
Posts: 52
Default setting focus to 3rd subform

I get error 2455 expression has invalid reference to property form/reprort.

I've tried:
Forms![frm1 Client]. _
Form![Reservationfrm]. _
Form![Jobfrm]. _
Form![Invoicefrm]. _
Form!txtHoldFocus.SetFocus

Also:

Me![Reservationfrm]![Jobfrm]![Invoicefrm].Form!txtHoldFocus.SetFocus

The code is attached to a button on the main form. I am attempting to add a
record at Invoicefrm using ".Form.AllowAdditions" and some other stuff, but I
cannot get the focus to Invoicefrm or a control on the form.

Can anyone see what I am doing wrong?

  #2  
Old September 25th, 2007, 03:40 PM posted to microsoft.public.access
Pieter Wijnen
external usenet poster
 
Posts: 1,354
Default setting focus to 3rd subform

Make sure the name of the Control holding the subform has the same name as
the Form.

HTH

Pieter

"redFred" wrote in message
...
I get error 2455 expression has invalid reference to property form/reprort.

I've tried:
Forms![frm1 Client]. _
Form![Reservationfrm]. _
Form![Jobfrm]. _
Form![Invoicefrm]. _
Form!txtHoldFocus.SetFocus

Also:

Me![Reservationfrm]![Jobfrm]![Invoicefrm].Form!txtHoldFocus.SetFocus

The code is attached to a button on the main form. I am attempting to add
a
record at Invoicefrm using ".Form.AllowAdditions" and some other stuff,
but I
cannot get the focus to Invoicefrm or a control on the form.

Can anyone see what I am doing wrong?



  #3  
Old September 25th, 2007, 03:48 PM posted to microsoft.public.access
redFred
external usenet poster
 
Posts: 52
Default setting focus to 3rd subform

Thanks for responding. Not sure what you mean.

"Pieter Wijnen" wrote:

Make sure the name of the Control holding the subform has the same name as
the Form.

HTH

Pieter

"redFred" wrote in message
...
I get error 2455 expression has invalid reference to property form/reprort.

I've tried:
Forms![frm1 Client]. _
Form![Reservationfrm]. _
Form![Jobfrm]. _
Form![Invoicefrm]. _
Form!txtHoldFocus.SetFocus

Also:

Me![Reservationfrm]![Jobfrm]![Invoicefrm].Form!txtHoldFocus.SetFocus

The code is attached to a button on the main form. I am attempting to add
a
record at Invoicefrm using ".Form.AllowAdditions" and some other stuff,
but I
cannot get the focus to Invoicefrm or a control on the form.

Can anyone see what I am doing wrong?




  #4  
Old September 25th, 2007, 03:56 PM posted to microsoft.public.access
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default setting focus to 3rd subform

The first approach will never work because subforms aren't actually part ot
the Forms collection.

Try:

Me![Reservationfrm]![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus

As Pieter pointed out, make sure that the name of the control containing the
subform is what you're using: depending how to add the subform to the parent
form, the name of the subform control may be different than the name of the
form being used as a subform.

You may find http://www.mvps.org/access/forms/frm0031.htm at "The Access
Web" a useful resource.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"redFred" wrote in message
...
I get error 2455 expression has invalid reference to property form/reprort.

I've tried:
Forms![frm1 Client]. _
Form![Reservationfrm]. _
Form![Jobfrm]. _
Form![Invoicefrm]. _
Form!txtHoldFocus.SetFocus

Also:

Me![Reservationfrm]![Jobfrm]![Invoicefrm].Form!txtHoldFocus.SetFocus

The code is attached to a button on the main form. I am attempting to add
a
record at Invoicefrm using ".Form.AllowAdditions" and some other stuff,
but I
cannot get the focus to Invoicefrm or a control on the form.

Can anyone see what I am doing wrong?



  #5  
Old September 25th, 2007, 03:58 PM posted to microsoft.public.access
Pieter Wijnen
external usenet poster
 
Posts: 1,354
Default setting focus to 3rd subform

Any subform on a form is basically just a control that contains a reference
to a form
hence the Referencing:

Forms!MyForm!ControlHoldingAForm.Form

The ControlHoldingAForm can have a different name than the form contained in
the control
Best is to look through all the controls on the containing form to verify
the control names

I Hope this clarifies matters

Pieter


"redFred" wrote in message
...
Thanks for responding. Not sure what you mean.

"Pieter Wijnen" wrote:

Make sure the name of the Control holding the subform has the same name
as
the Form.

HTH

Pieter

"redFred" wrote in message
...
I get error 2455 expression has invalid reference to property
form/reprort.

I've tried:
Forms![frm1 Client]. _
Form![Reservationfrm]. _
Form![Jobfrm]. _
Form![Invoicefrm]. _
Form!txtHoldFocus.SetFocus

Also:

Me![Reservationfrm]![Jobfrm]![Invoicefrm].Form!txtHoldFocus.SetFocus

The code is attached to a button on the main form. I am attempting to
add
a
record at Invoicefrm using ".Form.AllowAdditions" and some other stuff,
but I
cannot get the focus to Invoicefrm or a control on the form.

Can anyone see what I am doing wrong?






  #6  
Old September 25th, 2007, 04:24 PM posted to microsoft.public.access
redFred
external usenet poster
 
Posts: 52
Default setting focus to 3rd subform

Thanks to you both. Still I get the same message even after cut and paste
Doug's code.

The subform names are not the actual form names. My form "sfrm2 Invoice" is
what is contained on the subform I have named "Invoicefrm", so I think that's
ok -- right?

I do use tabs but I am under the impression that really doesn't matter as
controls on tabs are functionally the same as if the tabs were not there.
(Except the organization aspect).

I am really at wit's end but I'm sure solution is right here in front of me.


"Douglas J. Steele" wrote:

The first approach will never work because subforms aren't actually part ot
the Forms collection.

Try:

Me![Reservationfrm]![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus

As Pieter pointed out, make sure that the name of the control containing the
subform is what you're using: depending how to add the subform to the parent
form, the name of the subform control may be different than the name of the
form being used as a subform.

You may find http://www.mvps.org/access/forms/frm0031.htm at "The Access
Web" a useful resource.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"redFred" wrote in message
...
I get error 2455 expression has invalid reference to property form/reprort.

I've tried:
Forms![frm1 Client]. _
Form![Reservationfrm]. _
Form![Jobfrm]. _
Form![Invoicefrm]. _
Form!txtHoldFocus.SetFocus

Also:

Me![Reservationfrm]![Jobfrm]![Invoicefrm].Form!txtHoldFocus.SetFocus

The code is attached to a button on the main form. I am attempting to add
a
record at Invoicefrm using ".Form.AllowAdditions" and some other stuff,
but I
cannot get the focus to Invoicefrm or a control on the form.

Can anyone see what I am doing wrong?




  #7  
Old September 25th, 2007, 04:33 PM posted to microsoft.public.access
Pieter Wijnen
external usenet poster
 
Posts: 1,354
Default setting focus to 3rd subform

I might have missed something (and you're right about "Invoicefrm"/"sfrm2
Invoice")

Me![Reservationfrm].Form![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus

HTH
Pieter

"redFred" wrote in message
news
Thanks to you both. Still I get the same message even after cut and paste
Doug's code.

The subform names are not the actual form names. My form "sfrm2 Invoice"
is
what is contained on the subform I have named "Invoicefrm", so I think
that's
ok -- right?

I do use tabs but I am under the impression that really doesn't matter as
controls on tabs are functionally the same as if the tabs were not there.
(Except the organization aspect).

I am really at wit's end but I'm sure solution is right here in front of
me.


"Douglas J. Steele" wrote:

The first approach will never work because subforms aren't actually part
ot
the Forms collection.

Try:

Me![Reservationfrm]![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus

As Pieter pointed out, make sure that the name of the control containing
the
subform is what you're using: depending how to add the subform to the
parent
form, the name of the subform control may be different than the name of
the
form being used as a subform.

You may find http://www.mvps.org/access/forms/frm0031.htm at "The Access
Web" a useful resource.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"redFred" wrote in message
...
I get error 2455 expression has invalid reference to property
form/reprort.

I've tried:
Forms![frm1 Client]. _
Form![Reservationfrm]. _
Form![Jobfrm]. _
Form![Invoicefrm]. _
Form!txtHoldFocus.SetFocus

Also:

Me![Reservationfrm]![Jobfrm]![Invoicefrm].Form!txtHoldFocus.SetFocus

The code is attached to a button on the main form. I am attempting to
add
a
record at Invoicefrm using ".Form.AllowAdditions" and some other stuff,
but I
cannot get the focus to Invoicefrm or a control on the form.

Can anyone see what I am doing wrong?






  #8  
Old September 25th, 2007, 05:02 PM posted to microsoft.public.access
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default setting focus to 3rd subform

Yeah, I forgot that Reservationfrm is a subform as well, so the .Form is
required there as well.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Pieter Wijnen"
it.isi.llegal.to.send.unsollicited.mail.wijnen.no
wrote in message ...
I might have missed something (and you're right about "Invoicefrm"/"sfrm2
Invoice")

Me![Reservationfrm].Form![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus

HTH
Pieter

"redFred" wrote in message
news
Thanks to you both. Still I get the same message even after cut and
paste
Doug's code.

The subform names are not the actual form names. My form "sfrm2 Invoice"
is
what is contained on the subform I have named "Invoicefrm", so I think
that's
ok -- right?

I do use tabs but I am under the impression that really doesn't matter as
controls on tabs are functionally the same as if the tabs were not there.
(Except the organization aspect).

I am really at wit's end but I'm sure solution is right here in front of
me.


"Douglas J. Steele" wrote:

The first approach will never work because subforms aren't actually part
ot
the Forms collection.

Try:

Me![Reservationfrm]![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus

As Pieter pointed out, make sure that the name of the control containing
the
subform is what you're using: depending how to add the subform to the
parent
form, the name of the subform control may be different than the name of
the
form being used as a subform.

You may find http://www.mvps.org/access/forms/frm0031.htm at "The Access
Web" a useful resource.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"redFred" wrote in message
...
I get error 2455 expression has invalid reference to property
form/reprort.

I've tried:
Forms![frm1 Client]. _
Form![Reservationfrm]. _
Form![Jobfrm]. _
Form![Invoicefrm]. _
Form!txtHoldFocus.SetFocus

Also:

Me![Reservationfrm]![Jobfrm]![Invoicefrm].Form!txtHoldFocus.SetFocus

The code is attached to a button on the main form. I am attempting to
add
a
record at Invoicefrm using ".Form.AllowAdditions" and some other
stuff,
but I
cannot get the focus to Invoicefrm or a control on the form.

Can anyone see what I am doing wrong?








  #9  
Old September 25th, 2007, 05:28 PM posted to microsoft.public.access
redFred
external usenet poster
 
Posts: 52
Default setting focus to 3rd subform

Thanks again....same error message with this code:


Me![Reservationfrm].Form![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus


"Douglas J. Steele" wrote:

Yeah, I forgot that Reservationfrm is a subform as well, so the .Form is
required there as well.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Pieter Wijnen"
it.isi.llegal.to.send.unsollicited.mail.wijnen.no
wrote in message ...
I might have missed something (and you're right about "Invoicefrm"/"sfrm2
Invoice")

Me![Reservationfrm].Form![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus

HTH
Pieter

"redFred" wrote in message
news
Thanks to you both. Still I get the same message even after cut and
paste
Doug's code.

The subform names are not the actual form names. My form "sfrm2 Invoice"
is
what is contained on the subform I have named "Invoicefrm", so I think
that's
ok -- right?

I do use tabs but I am under the impression that really doesn't matter as
controls on tabs are functionally the same as if the tabs were not there.
(Except the organization aspect).

I am really at wit's end but I'm sure solution is right here in front of
me.


"Douglas J. Steele" wrote:

The first approach will never work because subforms aren't actually part
ot
the Forms collection.

Try:

Me![Reservationfrm]![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus

As Pieter pointed out, make sure that the name of the control containing
the
subform is what you're using: depending how to add the subform to the
parent
form, the name of the subform control may be different than the name of
the
form being used as a subform.

You may find http://www.mvps.org/access/forms/frm0031.htm at "The Access
Web" a useful resource.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"redFred" wrote in message
...
I get error 2455 expression has invalid reference to property
form/reprort.

I've tried:
Forms![frm1 Client]. _
Form![Reservationfrm]. _
Form![Jobfrm]. _
Form![Invoicefrm]. _
Form!txtHoldFocus.SetFocus

Also:

Me![Reservationfrm]![Jobfrm]![Invoicefrm].Form!txtHoldFocus.SetFocus

The code is attached to a button on the main form. I am attempting to
add
a
record at Invoicefrm using ".Form.AllowAdditions" and some other
stuff,
but I
cannot get the focus to Invoicefrm or a control on the form.

Can anyone see what I am doing wrong?









  #10  
Old September 25th, 2007, 09:36 PM posted to microsoft.public.access
Pieter Wijnen
external usenet poster
 
Posts: 1,354
Default setting focus to 3rd subform

Try them one by one & use dot notation all the way, to find the bug

Me.[Reservationfrm].Form.SetFocus
Me.[Reservationfrm].Form.Jobfrm.SetFocus
etc

HTFinallyH

Pieter

"redFred" wrote in message
...
Thanks again....same error message with this code:


Me![Reservationfrm].Form![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus


"Douglas J. Steele" wrote:

Yeah, I forgot that Reservationfrm is a subform as well, so the .Form is
required there as well.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Pieter Wijnen"
it.isi.llegal.to.send.unsollicited.mail.wijnen.no
wrote in message ...
I might have missed something (and you're right about
"Invoicefrm"/"sfrm2
Invoice")

Me![Reservationfrm].Form![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus

HTH
Pieter

"redFred" wrote in message
news Thanks to you both. Still I get the same message even after cut and
paste
Doug's code.

The subform names are not the actual form names. My form "sfrm2
Invoice"
is
what is contained on the subform I have named "Invoicefrm", so I think
that's
ok -- right?

I do use tabs but I am under the impression that really doesn't matter
as
controls on tabs are functionally the same as if the tabs were not
there.
(Except the organization aspect).

I am really at wit's end but I'm sure solution is right here in front
of
me.


"Douglas J. Steele" wrote:

The first approach will never work because subforms aren't actually
part
ot
the Forms collection.

Try:

Me![Reservationfrm]![Jobfrm].Form![Invoicefrm].Form!txtHoldFocus.SetFocus

As Pieter pointed out, make sure that the name of the control
containing
the
subform is what you're using: depending how to add the subform to the
parent
form, the name of the subform control may be different than the name
of
the
form being used as a subform.

You may find http://www.mvps.org/access/forms/frm0031.htm at "The
Access
Web" a useful resource.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"redFred" wrote in message
...
I get error 2455 expression has invalid reference to property
form/reprort.

I've tried:
Forms![frm1 Client]. _
Form![Reservationfrm]. _
Form![Jobfrm]. _
Form![Invoicefrm]. _
Form!txtHoldFocus.SetFocus

Also:

Me![Reservationfrm]![Jobfrm]![Invoicefrm].Form!txtHoldFocus.SetFocus

The code is attached to a button on the main form. I am attempting
to
add
a
record at Invoicefrm using ".Form.AllowAdditions" and some other
stuff,
but I
cannot get the focus to Invoicefrm or a control on the form.

Can anyone see what I am doing wrong?











 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.