Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error 1881 1

Status
Not open for further replies.

themiki

Programmer
Joined
Jul 3, 2003
Messages
4
Location
EE
Getting this error on pageframe's page activate
"Error with Edit1 - Value: Data type mismatch. Unbinding object edit1."
and there are only ok and help buttons (for some reasons there are no suspend or cancel or ignore buttons)
if I click Help then I will see following explanation

"Error loading file - record number n. "object" <or one of its members>. "Issue": "error" (Error 1881)
An error occurred while attempting to read in a form (.scx) file. Issue is one of “Properties,” “Methods,” or “User Properties.”"


Strangest part of it is that sometimes that error appear sometimes not.
on pageframe's page activate method I have following code(see code below)

Why I'm getting this error? This error has being terroring me whole month.
How to debug it? Then I go in debug, everything look normal.
I am very beginner programmer, so excuse that my code is lousy.
Could any body give me a hint how to catch sucha error.
I have in page error method following code

LPARAMETERS nError, cMethod, nLine
ON ERROR DO errhand WITH ;
ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )

and PROCEDURE errhand looks like following

PROCEDURE errhand
PARAMETER merror, mess, mess1, mprog, mlineno
?merror
?mess
?mess1
?mprog
?mlineno
CLEAR

but it dont catch my error.

Thanks for reading my message.



release uuringpuhver
public array uuringpuhver[1]
Store thisform.pageframe1.page1.grid1.id.text1.value to id1
Dimension nimetus[10,2]
Store thisform.pageframe1.page5.container1.optiongroup1.option1.caption to nimetus[1,1]
Store thisform.pageframe1.page5.container1.optiongroup1.option2.caption to nimetus[2,1]
Store thisform.pageframe1.page5.container1.optiongroup1.option3.caption to nimetus[3,1]
Store thisform.pageframe1.page5.container1.optiongroup1.option4.caption to nimetus[4,1]
Store thisform.pageframe1.page5.container1.optiongroup1.option5.caption to nimetus[5,1]
Store thisform.pageframe1.page5.container1.optiongroup1.option6.caption to nimetus[6,1]
Store thisform.pageframe1.page5.container1.optiongroup1.option7.caption to nimetus[7,1]
Store thisform.pageframe1.page5.container1.optiongroup1.option8.caption to nimetus[8,1]
Store thisform.pageframe1.page5.container1.optiongroup1.option9.caption to nimetus[9,1]
Store "1" to nimetus[1,2]
Store "2" to nimetus[2,2]
Store "3" to nimetus[3,2]
Store "4" to nimetus[4,2]
Store "5" to nimetus[5,2]
Store "6" to nimetus[6,2]
Store "7" to nimetus[7,2]
Store "8" to nimetus[8,2]
Store "9" to nimetus[9,2]

vaartus = thisform.pageframe1.page5.container1.optiongroup1.value
optiontyyp = nimetus[vaartus, 1]
paring = "select uuring.id, ttod(uuring.kp) from uuring where uuring.isikid = id1 and uuring.tyyp = optiontyyp into cursor uuringpuhver"
Select uuring.id, ttod(uuring.kp) from uuring where uuring.isikid = id1 and uuring.tyyp = optiontyyp into array uuringpuhver
Thisform.pageframe1.page5.container1.kuupaevad.rowsource = 'uuringpuhver'
_isikid = thisform.pageframe1.page1.grid1.id.text1.value
If !isnull(this.container1.kuupaevad.value)
This.container1.kuupaevad.setfocus
This.container1.kuupaevad.selected(1) = .T.
Endif
vaartus3 = thisform.pageframe1.page5.container1.kuupaevad.value
Select uuring
kursor4[1,1] = " "
kursor4[1,2] = " "
Locate for id = val(vaartus3)
If found()
Select uuring.kirjeldus, uuring.isikid from uuring where uuring.id = val(vaartus3) and uuring.isikid = id1 into array kursor4
Thisform.pageframe1.page5.container1.container1.edit1.refresh
Else
Thisform.pageframe1.page5.container1.container1.edit1.value = " "
Endif
id2 = thisform.pageframe1.page1.grid1.id.text1.value
vaartus3 = thisform.pageframe1.page5.container1.kuupaevad.value
select uuring
locate for id = val(vaartus3)
if found()
select uuring.kirjeldus, uuring.isikid from uuring where uuring.id = val(vaartus3) and uuring.isikid = id2 into array kursor4
thisform.pageframe1.page5.refresh
thisform.pageframe1.page5.container1.container1.edit1.refresh
endif
 
What is Edit1's ControlSource? If it's a global variable or a Form Property, make sure it's initialized to a string variable at least by the forms Load() method. By default these variable types are logical and set to .F., which is invalid for an editbox.

Rick
 
Thank you rgbean, that was too easy, I just cant believe it.
I initialized edit1 controlsource to empty string in form load and error disappear.
But why I have to do it? Why it isn't enough to initialize that variable in page activate method. I know it is a stupied question. I know very little about objects, events and sucha things.
 
The explanation (and the source of the error), is that when the EditBox object is created - sometime after the form LOAD() and before the form INIT() and a long time before the page activate - VFP needs to resolve the properties you have set for the EditBox control. When it sees that the ControlSource is a non-character value, it "unbinds" it from the control so it can finish instantiating this object, continue creating the rest of the objects on the form.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top