fanlinux90
Programmer
This is the code of the init of the form
This is the code for the process button
but it does not work with the first record, with the other records if the button code works and changes the control field to 2
Code:
if !used if !used ("supplier_temp")
SELECT supplier
afields(structure)
CREATE cursor supplier_temp from array structure
else
SELECT supplier_temp
for re = 1 to reccount()
SELECT supplier_temp
go re
_id = supplier_temp.id
_name = supplier_temp.name
_dir = supplier_temp.dir
_cel = supplier_temp.cellphon
_em = supplier_temp.email
scan
update provider set name=_name, address=_dir, cell=_cel, email = _em where control = 1 and id = _id
end scan
end for
delete all
endif
SELECT supplier_temp
APPEND FROM supplier for dispatched = 1
GO TOP
Thisform.Suppliers.RecordSource = "supplier_temp"
Thisform.Suppliers.column1.ControlSource = "supplier_temp.name"
Thisform.Proveedores.column2.ControlSource = "supplier_temp.direntre"
Thisform.Proveedores.column3.ControlSource = "provider_temp.cellphon"
Thisform.Suppliers.column4.ControlSource = "supplier_temp.email"
Code:
select supplier_temp
go top
replace supplier_temp.control with 2
locate for supplier_temp.control = 2
REPLACE supplier.control WITH supplier_temp.control for supplier.id = supplier_temp.control