Having got the fetching method to work, my next head scratcher is how to update the records. My failed attempts are highlighted in blue, the fields I want to update are in Red.
the fetching on the child table works fine, just cannot find the correct syntax to be able to change each selected record. Any Suggestions please?
I should add that the table is a saved table embedded in the parent form. This Code is on a button.
I have OnDblClick event working fine for individual records, but want the facility to update all filtered records at times.
the fetching on the child table works fine, just cannot find the correct syntax to be able to change each selected record. Any Suggestions please?
Code:
dim shared set_ptr as P dim shared parent_ptr as p dim shared child_ptr as p dim global vLocationOrder as c dim global vLoggingWhen as d dim global vLoggingWhere as c set_ptr = set.open_session("enterreglogging.set") parent_ptr = set_ptr.enterreginput child_ptr = set_ptr.logging filter = ".t." query.filter = "flattenquery("+filter+")" qry = parent_ptr.query_create() set_ptr.fetch_first() while .NOT. set_ptr.fetch_eof() if isblank("child_ptr.as") then ui_msg_box("",child_ptr.reg) [COLOR=#0000ff]' child_ptr.allow_change(.t.) ' child_ptr.change_mode() [/COLOR] [COLOR=#ff0000]child_ptr.when = var->vLoggingWhen child_ptr.where = var->vLoggingWhere child_ptr.h = var->vLocationOrder child_ptr.as = child_ptr.reg[/COLOR] [COLOR=#0000ff]' :EnterRegLogging:Tables:logging.change_begin() ' :EnterRegLogging:Tables:logging.where = var->vLoggingWhere ' :EnterRegLogging:Tables:logging.when = var->vLoggingWhen ' :EnterRegLogging:Tables:logging.h = var->vLocationOrder ' :EnterRegLogging:Tables:logging.reg = child_ptr.reg ' :EnterRegLogging:Tables:logging.change_end(.T.) ' topparent:Control_browse1.refresh_layout()[/COLOR] trace.writeln(child_ptr.reg+" was logged","Logging") else trace.writeln(child_ptr.reg+" seen on "+child_ptr.when,"Logging") end if set_ptr.fetch_next() end while set_ptr.close() parentform.Resynch()
I have OnDblClick event working fine for individual records, but want the facility to update all filtered records at times.
Comment