with This && SETING THE COLORS AND RECORDSOURCE if .HighlightRow if not empty(.RecordSource) .ColumnGotFocus() endif .nBackColor = .BackColor .SetAll('DynamicBackColor', ; 'iif(recno(This.RecordSource) = This.nRecno, ' + ; 'rgb(' + .cSelectedBackColor +'), ' + ; ltrim(str(.BackColor)) + ')') endif endwith local lcOrder, ; lcAlias, ; lnRecno dodefault() with This if not empty(.cDisplayTag) or not empty(.cSeekTag) lcOrder = iif(empty(.cDisplayTag), .cSeekTag, ; .cDisplayTag) lcAlias = .Parent.Parent.RecordSource if not upper(order(lcAlias)) == upper(lcOrder) set order to (lcOrder) in (lcAlias) lnRecno = recno(lcAlias) Thisform.LockScreen = .T. .Parent.Parent.Refresh() .Reposition(lnRecno, lcAlias) .Parent.Parent.Refresh() Thisform.LockScreen = .F. endif not upper(order(lcAlias)) == upper(lcOrder) endif not empty(.cDisplayTag) ... endwith local laColumns[1], ; lnSelect, ; lcKeyExpr, ; luKeyValue, ; lcDatabase, ; lcAlias, ; loLookup with This * Ensure the aColumns array has been properly set up, * the specified table is open, and the tag is defined. assert type('.aColumns[1, 1]') = 'C' and ; not empty(.aColumns[1, 1]) ; message 'SFPickListButton: aColumns not set up' assert type('.cAlias') = 'C' and ; not empty(.cAlias) and used(.cAlias) ; message 'SFPickListButton: cAlias not properly ' + ; 'specified' assert type('.cTag') = 'C' and not empty(.cTag) and ; tagno(.cTag, '', .cAlias) > 0 ; message 'SFPickListButton: cTag not properly ' + ; 'specified' * Set up the parameters we'll pass to the * SFPickList class. acopy(.aColumns, laColumns) lnSelect = select() select (.cAlias) lcKeyExpr = key(tagno(.cTag)) luKeyValue = evaluate(lcKeyExpr) lcDatabase = cursorgetprop('Database') lcAlias = iif(empty(lcDatabase), '', ; lcDatabase + '!') + .cAlias select (lnSelect) * Create the pick list and display it. loLookup = newobject('SFPickList', 'SFForms.vcx', '', ; lcAlias, ; @laColumns, ; .cCaption, ; lcKeyExpr, ; luKeyValue, ; .cTag) loLookup.Show() * If the user selected a record, find it and refresh * the form. if type('loLookup') = 'O' and ; not isnull(loLookup) and loLookup.lSelected = seek(loLookup.uKeyValue, .cAlias, .cTag) Thisform.RefreshForm() endif type('loLookup') = 'O' ... endwith with This dimension .aColumns[3, 5] .aColumns[1, 1] = 'customer.company' * .aColumns[1, 2] = 150 * .aColumns[1, 3] = 'Company' .aColumns[1, 5] = 'company' .aColumns[2, 1] = 'customer.city' * .aColumns[2, 2] = 100 * .aColumns[2, 3] = 'City' .aColumns[2, 5] = 'city' .aColumns[3, 1] = 'customer.contact' * .aColumns[3, 2] = 100 * .aColumns[3, 3] = 'Contact' endwith This article is reproduced from the November 1998 issue of FoxTalk. Copyright 1998, by Pinnacle Publishing, Inc., unless otherwise noted. All rights are reserved. FoxTalk is an independently produced publication of Pinnacle Publishing, Inc. No part of this article may be used or reproduced in any fashion (except in brief quotations used in critical articles and reviews) without prior consent of Pinnacle Publishing, Inc. To contact Pinnacle Publishing, Inc., please call 1-800-788-1900. ------------------------------------------------------------------------------ © 2000 Microsoft Corporation. All rights reserved. Terms of use.CLAUDIO