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

using appe blan in vfp6

Status
Not open for further replies.

rajivghare

Programmer
Mar 12, 2003
8
IN


dear friend

i am a fox 2.x programmer

I want to add records in a table using appe blan

what should i write in the click event of command butt.

kindly help.

thanks

rajiv

 
Hey Rajiv,

See if this helps u in ne way..
-----------------------------------------
IF USED(lcTableName) && check if table is already in use
SELECT lcTableName && if yes then select the workarea
ELSE
USE lcTableName && else open the table
ENDIF

APPEND BLANK

REPLACE Filed WITH Value && OR wtev u would like to do
-------------------------------------------

Please do let me know if you need any more help !!!

 
You can do it one of these two ways. The first is closest to Fox 2.x, but doesn't employ all the 'new' features of VFP buffering. Your controls on the form (text boxes, bombos, radio buttons and so on) all have control sources. Initialize variables with the same names as the table fields. You can use SCATTER MEMVAR BLANK in the form's Load event or the startup .prg. Set these to variables in the control source of the control. Add a control to the form. Right-click the control and select 'Properties'. Then scroll down to control source and input m.MyField1, whatever the name of the field you will be replacing. Repeat for all the controls you are using.
Now in the 'New' button, you will put another SCATTER MEMVAR BLANK. Edit the data, then in the 'Save' button put in either:
INSERT INTO MyTable FROM MEMVAR
-or-
APPEND BLANK
REPLACE MyField1 WITH m.MyField1
REPLACE MyField2 WITH m.MyField2
.
.
.
and so on.

The best way though is to check into buffering. Set the controls to the corresponding fields of the table, and let VFP do the work for you. It is a little in-depth to get into here since you know nothing about it, but if you look at the help files you will get some ideas.
Dave S.
[cheers]
 

Dear Niraj & dsummzzz


Thanks a lot.


my problem is solved.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top