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

getting a -1 when trying to replace a field in my form

Status
Not open for further replies.

melkhan

Programmer
Dec 4, 2000
1
US
I am trying to replace the value of an item field in table with the record number using a form generated by the form wizard in VFP 6.0 By typing the code "replace itemfield with RECNO()" and then "show gets" in the event (valid)and I end up with a -1.

Please help


Farouk Khan
 
Probably you should use "replace itemfield with RECNO() in MyTable"
Notes:
1. Never use Record Number as ID of recurd in table, because there are situations when it becomes not unique.
2. Show Gets is quite old method of working with forms. Read VFP programmer's guide, you will find a lot of things to learn there.

Vlad Grynchyshyn
vgryn@softserve.lviv.ua
The professional level of programmer could be determined by level of stupidity of his/her bugs
 
A record number can be -1 if you are using buffering. You'll have to issue a TableUpdate() in order to commit the record and get a "real" record number.

Ditto Vlad's comments above.

AA and welcome, Farouk.

Robert Bradley

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top