* Wizard buttons * cmdExit.click thisform.lockscreen = .t. thisform.dataenvironment.closetables with thisform.dataenvironment.cursor1 .database = curdir()+"testdata.dbc" .cursorsource = "customer" endwith thisform.dataenvironment.opentables open database curdir()+"testdata.dbc" nTableCnt = adbobject(aTables,"Table") for ix = 1 to nTableCnt if aTables[ix] = left(sys(2015),4) drop table (aTables[ix]) endif endfor thisform.lockscreen = .f. dodefault() * Change table * cmdButtonChange.click thisform.lockscreen = .t. thisform.dataenvironment.closetables with thisform.dataenvironment.cursor1 .database = home()+"samples\data\testdata.dbc" .cursorsource = "customer" .order = "Company" endwith thisform.dataenvironment.opentables thisform.refresh thisform.lockscreen = .f. * Back to original * cmdButtonBack.click thisform.lockscreen = .t. thisform.dataenvironment.closetables with thisform.dataenvironment.cursor1 .database = curdir()+"testdata.dbc" .cursorsource = "customer" .order = "Country" endwith thisform.dataenvironment.opentables thisform.refresh thisform.lockscreen = .f. * On the fly table * cmdButtonOnTheFly.click _screen.comment = sys(2015) cCompanies = left(customer.company,1) thisform.lockscreen = .t. select * from (thisform.dataenvironment.cursor1.alias) ; where Company = cCompanies ; into table (_screen.comment) index on company tag company use open database curdir()+"testdata.dbc" add table (_screen.comment) thisform.dataenvironment.closetables with thisform.dataenvironment.cursor1 .database = curdir()+"testdata.dbc" .cursorsource = _screen.comment .order = "company" endwith thisform.dataenvironment.opentables thisform.refresh thisform.lockscreen = .F. *Change controlsource on the fly *cmdButtonCSource.click if ThisForm.COMPANY1.controlsource = "customer.company" ThisForm.COMPANY1.controlsource = "customer.contact" ThisForm.CONTACT1.controlsource = "customer.company" else ThisForm.COMPANY1.controlsource = "customer.company" ThisForm.CONTACT1.controlsource = "customer.contact" endifCetin