kengooch
Member
- Local time
- Yesterday, 18:16
- Joined
- Feb 29, 2012
- Messages
- 137
I have several list boxes that allow a user to input a value and it then filters the form accordingly.
However, one of the fields is a lookup box and it shows the actual value, but hidden behind that is the record ID.
How can I modify the following code to read the content of the box and interpret it so that it passes the Record ID to the filter.
Form Name: fAccList
Field to filter: tSpecCode (this is the lookup field and though it might show DM, the actual Record ID is an auto field and the value is really 7 )
Text box name: luCode (this is the field where the user enters the value DM that needs to translate and understand that DM is really 7 )
In the AfterUpate Macro under the Where condition I have the following.
[tSpecCode] Like "*" & [Forms]![fAccList]![luCode] & "*"
This works fine for fields that are not linked. Because the value in the field is the exact value to look up. But Somehow if the field shows the lookup value but only stores the IDKey, it doesn't work.
I would also love to see this answer in actual VBA code if possible. For some reason I understand VBA much better than Macro's.
Thanks so much for your help.
Ken
However, one of the fields is a lookup box and it shows the actual value, but hidden behind that is the record ID.
How can I modify the following code to read the content of the box and interpret it so that it passes the Record ID to the filter.
Form Name: fAccList
Field to filter: tSpecCode (this is the lookup field and though it might show DM, the actual Record ID is an auto field and the value is really 7 )
Text box name: luCode (this is the field where the user enters the value DM that needs to translate and understand that DM is really 7 )
In the AfterUpate Macro under the Where condition I have the following.
[tSpecCode] Like "*" & [Forms]![fAccList]![luCode] & "*"
This works fine for fields that are not linked. Because the value in the field is the exact value to look up. But Somehow if the field shows the lookup value but only stores the IDKey, it doesn't work.
I would also love to see this answer in actual VBA code if possible. For some reason I understand VBA much better than Macro's.
Thanks so much for your help.
Ken