Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strange Combo box activity
Message
From
07/11/1997 13:36:50
Edward Crawford
City Facilities Management
Glasgow, United Kingdom
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00058742
Message ID:
00058936
Views:
32
>>I have an account table with a field called contactid. This field stores a code that relates to a contactId field in the Contact table. The contact table stores the name, phone, etc. of the person who is the contact for the account.
>>
>>I have a combo box with the following properties:
>> .RowSourceType = 6
>> .RowSource = Contact.contact,contactId
>> (contact is the persons name, contactId is the Id number
>> .BoundColumn = 2
>> .ControlSource = Account.ContactId
>> .DisplayValue = Contact.Contact
>>
>>I want to display the contact's name in the combobox (.DisplayValue = contact.contact), and I want the contact name to change to the appropriate contact when you move to a differenct account (.BoundColumn=2 and .ControlSource = Account.ContactId). This all works fine. The problem is when I try to edit the Contact's name in the text portion of the combobox. As soon as I type anything, the pointer in the contact table moves to the bottom of the table and writes the changed name in the contact field and writes a blank in the contactId field. The original record is still there. The pointer just seems to go to the bottom and overwrite the last record. Is there a setting that I am missing here?
>>
>>-Ed
>
>Ed, you'll have to unlink the ControlSource and handle that portion in code in your LostFocus. Search on this topic - Ed Pikman has written several complete sets of directions how to handle these problems.
>
>HTH
>Barbara

I tryed what Ed suggests. I cleared the .ControlSource and do a REPLACE in the LostFocus Event, but it still jumps to the bottom as soon as I start editing. So, I just SEEK contactId in the Table before I REPLACE in the LostFocus Event, and that works.

Ed
Previous
Reply
Map
View

Click here to load this message in the networking platform