The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Populate text box from TLookupEdit
Posted: 18 Sep 09 4:08 AM
|
I am trying to populate a text box with the choice a user makes from an TLookupEdit on Account Name. Whether this occurs automatically once the choice has been made or on button press i dont mind.
I have tried TheLookup.Text but obviously that didnt work. As this is on the Activity Details view form of an existing activity i have also tried Activity.AccountName but this displays the last Account Name to be saved against the Activity and not the one the user has chosen in the TLookupEdit.
Any ideas? |
|
|
|
Re: Populate text box from TLookupEdit
Posted: 18 Sep 09 1:42 PM
|
1. you need to have access to the form.
2. OnPopupReturn event will give you the answer or the 'hook' to get the answer. luecontrol.TEXT contains the field value that was specified in the Lookup. lueControl.LookupID will contain the ID field value that was specified in the Lookup. These both can be changed (but the change will affect ALL screens that use this lookup!).
3. If the text doesn't contain what you want....you can quick fire off a script that gets the data based on the ID returned in LookupID....we do that a lot. You can use GetField or GetFields oran ADO recordset to get the data desired.
|
|
|
|
Re: Populate text box from TLookupEdit
Posted: 21 Sep 09 3:57 AM
|
Thanks for pointing me in the right direction, i have it working now using the lookupid in the getfield sql statement.
Many Thanks. |
|
|
|