oForm = CREATEOBJECT("Form1") oForm.Show() READ EVENTS ************************************************** *-- Form: form1 (d:\all_zapl\test.scx) *-- ParentClass: form *-- BaseClass: form *-- Time Stamp: 10/14/04 10:34:03 AM * DEFINE CLASS form1 AS form DoCreate = .T. Caption = "Form1" Name = "Form1" DIMENSION acaption[1] DIMENSION atables[1] ADD OBJECT list1 AS listbox WITH ; RowSourceType = 5, ; RowSource = "thisform.aCaption", ; Height = 207, ; Left = 15, ; Top = 28, ; Width = 151, ; Name = "List1" ADD OBJECT combo1 AS combobox WITH ; RowSourceType = 5, ; RowSource = "thisform.aTables", ; Height = 24, ; Left = 15, ; Style = 2, ; Top = 2, ; Width = 151, ; Name = "Combo1" PROCEDURE fillcaptions LPARAMETERS cTable LOCAL nFields cTable = JUSTSTEM(cTable) SELECT 0 USE (cTable) IN 0 ALIAS MyTest DECLARE thisform.aCaption[FCOUNT()] STORE "" TO thisform.aCaption TRY DBGETPROP(cTable,"TABLE","Path") FOR nFields = 1 TO FCOUNT() cCaption = DBGETPROP(cTable+"."+FIELDS(nFields),"FIELD","Caption") IF EMPTY(cCaption) && You forgot to put Caption in Your table thisform.aCaption[nFields] = FIELDS(nFields) ELSE thisform.aCaption[nFields] = cCaption ENDIF NEXT CATCH && Free table FOR nFields = 1 TO FCOUNT() thisform.aCaption[nFields] = FIELDS(nFields) NEXT ENDTRY USE IN MyTest thisform.List1.Requery() ENDPROC PROCEDURE Init STORE "" TO thisform.aCaption, thisform.atables dbc_path = "" DO WHILE EMPTY(dbc_path) dbc_path = GETFILE("DBC","Choose database","Choose", 0, "Choose database") IF .NOT. JUSTEXT(dbc_path) == "DBC" dbc_path = "" *** Inform here Your user ENDIF ENDDO OPEN DATABASE (dbc_path) m_path = ADDBS(JUSTPATH(dbc_path)) ADIR(thisform.atables, m_path+"*.DBF") thisform.Combo1.Requery() ENDPROC PROCEDURE Destroy CLEAR EVENTS ENDPROC PROCEDURE combo1.InteractiveChange thisform.FillCaptions(This.DisplayValue) ENDPROC ENDDEFINE * *-- EndDefine: form1 **************************************************