INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Error 2465 Application-defined or object-defined error

Error 2465 Application-defined or object-defined error

(OP)
Hi All,

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

CODE

Private Sub Form_Current()
SetRating Form_RecipesNew, Me.cRating
End Sub 

The code on the star image is below. There are 5 stars with identical code except for the img no

CODE

Private Sub imgSt1_Click()

SetRatingClick Me.imgSt1, Me.cRating

End Sub 
I think is it due to relationships between the Navigation Form and the subform. Just need some help to figure this out please.

KP




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

Try this.
Private Sub Form_Current()
Forms![Main Form Name]![Form_RecipesNew].Form.cRating
End Sub
I hope that helps.

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

(OP)
Hi Laurie,
Thank you for your reply. I had previously tried this reference plus many others! But still comes up with this error when you click on a star.

Perhaps the only way is to make the recipe form a pop up form which works, and then the user can rate his recipe.
What do you think?

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

(OP)
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

integrity:

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.

It is THAT name that you should refer-to in:

CODE

Forms![Form2]![Form_Recipes-new].Form.cRating (in place of [Form_Recipes-new]).
   ^      ^            ^            ^       ^
   |      |            |            |       |
Command Parent     Container    Sub-form  Control 

Replace [Form_Recipes-new] with that container name.

Sorry if I'm wrong (great if I'm right and you now know how it works).

Def

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close