Reputation: 86
I have a access vba application. when i try to search for invoice using the
DoCmd.FindRecord strOrdNum, acEntire, False, acDown, False, acCurrent, True
It works when the strOrdNum is something like 123 or 1111. However for the records with strOrdNum that has "#" in them it does not work. For example for one of the records I have 11234#223, but it does not find it. Any ideas on how I can deal with these cases. Thanks
Upvotes: 0
Views: 94
Reputation: 2251
As @OverMind mentioned, I think it's a wildcard issue. This worked for me. Replace:
DoCmd.FindRecord strOrdNum, acEntire, False, acDown, False, acCurrent, True
with:
DoCmd.FindRecord Replace(strOrdNum, "#", "[#]"), acEntire, False, acDown, False, acCurrent, True
This will force it to search for the literal.
Upvotes: 2