Eduardo Fuerte
asked on
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.
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.
ASKER
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
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
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.
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.
ASKER
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.
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.
If data are filtered then what is in filter expression?
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?
BTW, do you have some error handling procedure in your code which could save the app state when the error appears?
ASKER
ASKER
ASKER
Ops...
The filter:
*-- During development it's fixed in
thisform.s_emp="0000000004 "
SELECT DESP
SET FILTER TO SB_EMP = thisform.s_emp
LOCATE
The filter:
*-- During development it's fixed in
thisform.s_emp="0000000004
SELECT DESP
SET FILTER TO SB_EMP = thisform.s_emp
LOCATE
ASKER
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.
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.
Use macro substitution
m.sb_emp = thisform.s_emp
SET FILTER TO SB_EMP = "&sb_emp"
m.sb_emp = thisform.s_emp
SET FILTER TO SB_EMP = "&sb_emp"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello
I hadn't a chance to test your solution by the way it looks fine
I guess I declare
_screen.AddProperty("MyFil ter","Filt erValue")
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)
I hadn't a chance to test your solution by the way it looks fine
I guess I declare
_screen.AddProperty("MyFil
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)
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
More details: http://en.wikipedia.org/wiki/SMS_language
This is also interesting: http://www.abbreviations.com/BTW
ASKER
Good... I'm planning next semester to return to my English classes.
And what is the code executed?