07-17-2013 05:36 PM
I created a new form and I added a lookupEdit field that opens up an Account lookup.
I would like to search in the lookup based on the account name, but store the AccountID selected and not the name of the account.
As default it stores the the Account name (Since that is the field I'm doing a search on).
07-18-2013 12:57 AM - edited 07-18-2013 12:58 AM
This is what it actually does by default?
Look at the Account lookup - you find the account by name, but it stores the ID, not the name. I think you have set the control incorrectly. It should be this:
1) Control.LookupID - bound to the column in DB. This would be the ID returned from the lookup e.g. AccountID
2) Control.Text - the textual version of the lookup e.g. Account (and any joins to get that data in here)
The lookup itself has a property called ID Field - this is what is returned from the lookup irrespective of what the user searched for. This is what would be populated into yourControl.LookupID (or should be).