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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error: function requires row or table buffering mode

Status
Not open for further replies.

R17

Programmer
Jan 20, 2003
267
0
0
PH

why am i having error "function requires row or table buffering mode" at this line,

if !tableupdate()
thisform.txtempno.setfocus()
return
endif


in my form's load event i have,

set multilocks on
=cursorsetprop("buffering",5,"money")
=tableupdate(.t.)
thisform.refresh()


any help pls?
 
Try -- SELECT Money -- before TableUpdate
or try TableUpdate(.T.,.F.,'Money')
 
R17

in my form's load event i have,

set multilocks on
=cursorsetprop("buffering",5,"money")
=tableupdate(.t.)
thisform.refresh()


I'm surprised this code works for you, you can rarely refer to any this in the load of the form since this does not exist yet. Try moving this code to the init of the form.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi

Forms Init events may be a better place to put that code.

OR if you are opening the tables in the DE, you can even set that property in the DE of the form.
You can do that by setting the BufferModeOverride property in the DE. If that is left at its default value of 1 (which means to take the same a s the forms value, then, set the forms BufferMode property to apply to all the tables which have that default value.

:)






____________________________________________
ramani - (Subramanian.G) :)
 
Mike,

you can rarely refer to any this in the load of the form since this does not exist yet.

Are you sure about that? Are you perhaps confusing it with _SCREEN.ActiveForm? In a form's Load, the active form is still the previously active form. But THIS and THISFORM should work OK.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Mike and mirekzvolsky

The following gives me an error

Code:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"
	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 168, ;
		Top = 84, ;
		Width = 100, ;
		Name = "Text1"
	PROCEDURE Load
		thisform.text1.value =1
	ENDPROC
ENDDEFINE


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Of course. THISFORM is OK, but THISFORM.Text1 isn't, because first runs Form.Load, then objects(controls) are created, then runs Form.Init.
 

putting the code in the init event did not solve my problem, however mirekzvolsky's solution did!

thanks a lot!
 
mirekzvolsky

Of course. THISFORM is OK, but THISFORM.Text1 isn't, because first runs Form.Load, then objects(controls) are created, then runs Form.Init.

I was merely suggesting that using THIS anything in the load is bad programming pratice, since a beginner might use thisform in the load of the form and one day he might try thisform.text1 and get an error and not know why.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top