I have an application recently converted from v7. Now, when I call the Find Command (see below), I can't get it to default to search the entire form.
When I click the Search button, the Look In box is gray (w/ value of form name) but when I "Find" I get a message saying the current control can't be searched.
So, now my code looks like this:
DoCmd.GoToControl ("VendorNum" ' give field focus
SendKeys "%hs%e%ru%n", False ' set Find defaults
DoCmd.RunCommand acCmdFind ' run Find
The "SendKeys" line came from some postings I saw refering to Access 97 and below. It doesn't completely work in XP (everything except the "%e" - clear Search Only Current Field - seems to work).
With the GoToControl line, the field gets focus and the Look In box becomes available, but I don't want the default to be the field. I want the form.
Any ideas?
Thanks,
Brian
When I click the Search button, the Look In box is gray (w/ value of form name) but when I "Find" I get a message saying the current control can't be searched.
So, now my code looks like this:
DoCmd.GoToControl ("VendorNum" ' give field focus
SendKeys "%hs%e%ru%n", False ' set Find defaults
DoCmd.RunCommand acCmdFind ' run Find
The "SendKeys" line came from some postings I saw refering to Access 97 and below. It doesn't completely work in XP (everything except the "%e" - clear Search Only Current Field - seems to work).
With the GoToControl line, the field gets focus and the Look In box becomes available, but I don't want the default to be the field. I want the form.
Any ideas?
Thanks,
Brian