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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|