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!

Grid for data entry

Status
Not open for further replies.

wrov

Programmer
Nov 1, 2002
43
PY
Hello

I need to input data in a GRID which columns are not in the same order that the table.

If I write the instructions:

with ThisForm.Grid1
.RecordSource = "CUSTOMER"
.Column1.ControlSource = "PHONE"
.Column2.ControlSource = "EMAIL"
endwith

I can see the columns in this order but can't edit or modify data.

P.S.: The Grid and the Columns have ReadOnly = .F.

¿ Some solution ?

Thanks in advance

Walter.
 
HI,

I think, you are having tha table opened read only OR.. you are using a cursor called CUSTOMER and not direct table. OR you could be using a VIEW is called CUSTOMER and the view is set not updatable. If that is identified and changed you should be able to edit.

CURSOR will be read only. VIEWs can be updatable to modify the related table.

If you are not sure, first try without setting the individual columns control source and see if you can edit.
with ThisForm.Grid1
.RecordSource = "CUSTOMER"
endwith
If this is editable, then there is something which you have not specified.

If you are using a view, make sure that the view is updatable.

If your problem is that the data is not updated to the table, then probably you have to check the BUFFER mode in the data environment. If you are using buffer mode then, you have to use TABLEUPDATE() to save the change. Read the help on TABLEUPDATE() and realted buffers.

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Hello:


1. I am using VFP 6.0
2. The table is not open ReadOnly (therefore is Read Write)
3. I am using direct table
4. I'm not using a VIEW
5. Yes, writing:
with ThisForm.Grid1
.RecordSource = "CUSTOMER"
endwith
I can edit but in the order of the table (and I want in another order)
6. The problem is that the Grid not allow me edit. I can see the fields but I can't edit them.
 
HI
You can copy the following as a test.prg and run. Hope this helps you to compare and debug yours.
****************************************
** test form with grid
PUBLIC oForm
oForm1 = CREATEOBJECT("form1")
oForm1.show(1)
return
*****************************************
DEFINE CLASS form1 as form
PROCEDURE LOAD
** Create a temp table for our testing purpose
CREATE TABLE temp (Names C(35), Address M, ;
Fax C(10), Tel c(10), email C(20))
** Insert 10 records for our testing
SCATTER MEMVAR BLANK

FOR I= 1 TO 10
m.names = "MyName "+TRANSFORM(I,"@LR999999")
INSERT INTO temp FROM MEMVAR
ENDFOR
LOCATE
ENDPROC


PROCEDURE init
ThisForm.Width = 540
ThisForm.addobject("grid1","grid")
WITH ThisForm.Grid1
.Width = 516
.RecordSource = "TEMP"
.ColumnCount = 4
.Column1.ControlSOurce = "temp.Names"
.Column1.Header1.Caption = "Names"
.Column2.ControlSOurce = "temp.tel"
.Column2.Header1.Caption = "Tel"
.Column3.ControlSOurce = "temp.fax"
.Column3.Header1.Caption = "Fax"
.Column4.ControlSOurce = "temp.email"
.Column4.Header1.Caption = "Email"
.Visible = .t.
ENDWITH
ENDPROC

PROCEDURE destroy
CLOSE TABLES
ENDPROC
ENDDEFINE
*****************************************

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Thank you Ramani

I will try your solution.
 
Thank you Ramani

I shall try your solution.

Walter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top