Base-4.3.6-mac 10.8.5/ refresh subform error 1507

Dear programmers,

I created a database for my movies. On the form to enter a new movie, I can add a new person (author or actor) or a new category. But after entering the new person, I can’t refresh the form. I tried different macros (searched a lot on internet). But every time I got an error. Until now it was "Error #1507 (Form 'not identified in database Forms set) occurred in a call to function ‘Forms’. I just tried and now it is “Object variable non set”.

Of course, I am a newbie and even if I did some small programming on other softwares, I feel really lost. I searched a lot but didn’t find anything yet that would solve the matter.

If anyone could “enlighten me” I would be more than glad.

Thank you.

Cle

PS: you can get my database here: Dropbox - Error

Maybe confusion about the kind of Form you are trying to invoke? There are Forms in the LO main window and there are Forms in the form navigator once you have opened a form. See this post for sample code invoking both kinds of forms.

In your database, routine Macro_Reload, instead of:

  Set ofForm = Application.forms("Form_NewMovie")
  ofForm.refresh 

consider:

  ofForm = ThisComponent.Drawpage.Forms.getByName("MovieForm")
  ofForm.reload

Thank you so so so much. I’ll try that.

Could you, please, indicate the precise scenario which causes the error message as described ?

Also, why is the form “Form_NewMovie” apparently related to the table “Tab_MovieAuthor” ?

Thanks.

JPL

I thought the error was saying it couldn’t find the object named in quotes in the set of forms that was invoked, because there was no Form of that type. There is a subform on Form_NewMovie called AuthorForm which uses Tab_MovieAuthor as the recordset. I did not actually see that functionaity in action, but it is visible through the form navigator.