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!

Buffering data... and new records.

Status
Not open for further replies.

ArevProgrammer

Programmer
Apr 7, 2001
38
0
0
US
Hi,

I have a user entry form where you can add or edit user records, and the buffering being used is pessimistic. It is how i am performing a certain operation that is confusing me. If i add a new record, ie... a new user id that does not exist, and you hit the save button, i perform an operation like this...

M.thisrec = RECNO()
SELECT 'user'
SET ORDER TO 'user_id'
SEEK ALLTRIM(ThisForm.txtUser_id.Value)
IF FOUND() .AND. .NOT. M.adding
WAIT WINDOW ''
GO M.thisrec
ELSE
GO M.thisrec
DO make_resrc <-- operation of concern
ENDIF
M.adding = .F.

but, even if the record does exist and i only edit the user name, or permissions and hit save it still runs the make_resrc routine, which it shouldn't unless it is a new user id that does not exist in the table. So i am wondering if it is something to do with buffering, or am i supposed to move off the record and scan the table. This was taken from FPD2.6 DOS and it works great... I'm using VFP 7.0 with SP1 installed.


Scott

Rome was not built in a day. Be patient!
 
Hi


M.thisrec = RECNO()
SELECT user
SET ORDER TO user_id
IF SEEK(ALLTRIM(ThisForm.txtUser_id.Value))
** This is an existing record
m.ThisRec = Recno()
M.adding = .F.
ELSE
** New Record
M.adding = .t.
DO make_resrc <-- operation of concern
ENDIF

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top