update records through forms
I can display record into the text boxes of form and can also save it through text box but I want to update the displayed records .... how to do that??
Hi Sudeshna Basu
Not a problem. You must declare the object that accesses your user defined table.
Dim oUpDateTable As SAPbobsCOM.UserTable = Nothing
Then assign your user defined table, dont place the @ sign for your table name
oUpDateTable = oCompany.UserTables.Item("YourTable")
Forget about the loop, lets assume you doing just one value. Forget about RS, that was something i used in my code for something else.You need to get the record by it's key so you can update that row. The key is the code column of your table.
If oUpDateTable.GetByKey(CodeColumnValue) Then
'so if it found that code it would go inside here
'get the column and assign a value
oUpDateTable.UserFields.Fields.Item ("YourField").Value = "Value"
'then update the table, if value is 0
'it is succesfull
if oUpDateTable.Update()<>0 Then msgbox("error")
Hope this helps