What means vfp message: object is not contained in a form

Hi Experts

Do you know what it means and the workaround ?

"object is not contained in a form"

Amazingly it appears in a chunck of code aparently with no relation with the bug.

Thanks in advance.

Eduardo FuerteDeveloper and AnalystAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pcelbaCommented:
Do you use scope resolution operator (::) somewhere?

And what is the code executed?
0
Eduardo FuerteDeveloper and AnalystAuthor Commented:
Hello Pcelba !

I  really didn't use ::

the code is in the picture, a method from cls_db class that just pass to the next record...
img-vfp-erro.JPG
0
pcelbaCommented:
So, it seems your Command3.Click should move record pointer in current workarea.

This could also mean some Form event is trying to fire when the record pointer moves. The error could be caused by fact the "prox" method is not in a form but in some standalone class.

You may try to create a new Form method called "proxTemp" containing "SKIP" code from your picture and change the Command3.Click code to call this method instead of VCX library code. The debugger then should show what code is called on the SKIP command if you click on the "Step Into" debugger button.
0
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Eduardo FuerteDeveloper and AnalystAuthor Commented:
I did that no other code, only skip... by the way the table data is filtered

The class is also used in another project with no errors in the form's init event

thisform.fodb   = CREATEOBJECT("cls_Db")

being fodb a form's property.

0
pcelbaCommented:
If data are filtered then what is in filter expression?
0
pcelbaCommented:
And also, could you print out call stack when the error occurs?

BTW, do you have some error handling procedure in your code which could save the app state when the error appears?
0
Eduardo FuerteDeveloper and AnalystAuthor Commented:
Hello

Here is the error log.
Erros-Livesp.log
0
Eduardo FuerteDeveloper and AnalystAuthor Commented:
Sorry

I've put the incorrect one, please consider this.
Erros-Livesp.log
0
Eduardo FuerteDeveloper and AnalystAuthor Commented:
Ops...

The filter:

*-- During development it's fixed in
thisform.s_emp="0000000004"

SELECT DESP
SET FILTER TO SB_EMP = thisform.s_emp
LOCATE
0
Eduardo FuerteDeveloper and AnalystAuthor Commented:
Here, again...

That's the problem:

Using the form property in the filter expression has made the "mass"

if I use

SELECT DESP
SET FILTER TO SB_EMP = "0000000004"  && instead of  SET FILTER TO SB_EMP = thisform.s_emp
LOCATE

Everithing is fine, but the filter must to be dynamic in the production system,so, to workaround I've declared m.sb_emp="" as a public variable in the main program(*) and in form method did:

(*) since m.sb_emp will be util in another contexts of the system too

m.sb_emp = thisform.s_emp

*--Despesas apenas da Empresa
SELECT DESP
SET FILTER TO SB_EMP = m.sb_emp
*--SET FILTER TO SB_EMP = thisform.s_emp
LOCATE

And everithing is fine again....

Any other suggestions ?

Thanks.
0
tusharkanvindeCommented:
Use macro substitution

m.sb_emp = thisform.s_emp
SET FILTER TO SB_EMP = "&sb_emp"
0
pcelbaCommented:
Yes exactly. The filter should be independent on any variable and/or object. You never know where and when it can be evaluated.

The macro substitution for a string constant is possible solution in this case but it is static. To "simulate" the dynamic behavior you have to execute SET FILTER command whenever the variable contents change.

Another option is to place the filter value into a new _screen property which is better than variable and which remains dynamic:

_screen.AddProperty("MyFilter","FilterValue")
SET FILTER TO SB_EMP = _screen.MyFilter

Above property will always exist (after the first definition) and is always visible not like variable.

BTW, if you have index on SB_EMP column then you could use SET KEY instead of SET FILTER which is much faster.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Eduardo FuerteDeveloper and AnalystAuthor Commented:
Hello

I hadn't a chance to test your solution by the way it looks fine

I guess I declare

_screen.AddProperty("MyFilter","FilterValue")
SET FILTER TO SB_EMP = _screen.MyFilter
at  the main prg

One last thing what does "BTW" means ? (it sounds like an Aircraft Company, rsrs)

 
0
pcelbaCommented:
BTW menas "By the way" in this context. It is common SMS (Short Messaging Service) abbreviation used in e-mails also.

More details: http://en.wikipedia.org/wiki/SMS_language
This is also interesting: http://www.abbreviations.com/BTW
0
Eduardo FuerteDeveloper and AnalystAuthor Commented:
Good... I'm planning next semester to return to my English classes.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FoxPro

From novice to tech pro — start learning today.