Error 2465 Application-defined or object-defined error

Error 2465 Application-defined or object-defined error

I am using some code by Daniel van den Berg re having a star rating on a form. On the subform it works ok.But when the subform is on the navigation Form (access 2007) it gives this error.
The code below is on the subform

RE: Error 2465 Application-defined or object-defined error

I truly do not mean to insult your intelligence here, just checking - you did put in the name of the main form in
Forms![Main Form Name]![Form_RecipesNew].Form.cRating? I copied that right from my own code and it worked for me. What version of Access are you using?
If it works as a pop up, go for it!

RE: Error 2465 Application-defined or object-defined error

Hi Laurie..
Thanks for your reply.
Just to try it again,
I used a blank form (Form2) and used Recipes-New as a subform.
On the after event of the Recipes New is below

CODE

Forms![Form2]![Form_Recipes-new].Form.cRating

Still have the same issue.
When the form opens I just get this error, MS access can't find the field 'Form_Recipes-New referred to in your expression'
So I think I will just go with a pop up form where the code works ok. Just wasted enough time on it.

Thank you for your help
KP

RE: Error 2465 Application-defined or object-defined error

I think that you may have fallen into the trap that I did (years ago).

Your sub-form does not sit DIRECTLY on your parent form, it is sat within a 'container' that holds your sub-form.
So, when you state: Forms![Form2]![Form_Recipes-new].Form.cRating, 'Form_Recipes-new' IS NOT referencing your sub-form, but your sub-forms CONTAINER (which then references your sub-form via the use of '.form')

Right-click the OUTER edge of your sub-form (that is on your master form), and select 'properties'.
You should see a completely different name, which is your sub-form container name.