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!

problem with editing a field within a form 3

Status
Not open for further replies.

Phil Thoms

Programmer
Oct 31, 2005
245
0
16
GB
I have a very simple form with 4 fields, 3 are read only and the fourth is editable but when I run the form I can't edit this field.
The property for this editable field is NOT read only so do I need to switch off/on some other property?
 
A few things to check:

- If the field has a control source, make sure the table has at least one record in it;

- And that the table is not at end of file.

- Make sure the control is not disabled (check the Enabled property).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Positioned on an exisiting field. By the way I am using VFP version 6.0.
Thanks
 
VFP6 does not differ in that respect to any newer version. If you are at EOF() of the table you bind to, it doesn't matter if the field exists and the controlsource is valid, you are not on an editable record.

The same goes if you bind to a cursor that is readonly, even if not at EOF. VFP6 has no READWRITE SQL-Select clause, so if you want to edit something, you either need to bind to a table or an updatable view.

Bye, Olaf.
 
The three things Mike mentioned are all OK.
Table has many records.
Not at end of file.
Control is not disabled.
 
Another way a field (is it a textbox?) could be uneditable is if the When event contains code that returns .F. A longshot, but possible.


Jim
 
In regard to When,

also Valid could simply deny changes, interactivechange can also be programmed to reset the original value.


You didn't even mention yet, how you bind the textbox to the field. What's your controlsource? If it's just the field name, for example, it is very depending on the table being the selected workarea.

And what is your controlsource, is it a table, really, or is it a cursor you create via SQL or is it a view or is it a cursor created by sqlexec or what?

Bye, Olaf.
 
Well, the next step is to look at all the properties of the control that have been been changed (they show up in bold in the properties window). Do the same for the form's properties. And also all the method code.

Try reversing the changes, one by one, until the problem goes away.

Alternatively, remove the control from the form. Then add another textbox (or whatever it is) in its place. Gradually change the properties and add the method as they were before until the problem comes back.

Either way, that should tell you want is causing the problem.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top