By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,637 Members | 1,967 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,637 IT Pros & Developers. It's quick & easy.

Find record in subform on Tabcontrol

100+
P: 547
I want to add a Button to a Tab control called "TabCtl429" and the page index = 2. The button must open the find record dialog specifically in the "racenumber" field of the "RacetimingSF" subform on this "page index = 2.

When i use this code, it finds records all over the main form (RacesetupXCF) and subform (RacetimingSF), instead of focusing only on the racenumber field in this specific subform.


Expand|Select|Wrap|Line Numbers
  1. [Forms]![RaceSetupXCF]![RaceTimingSF]![RaceNumber].SetFocus
  2.     DoCmd.GoToControl Screen.PreviousControl.Name
  3.     Err.clear
  4.     DoCmd.RunCommand acCmdFind
i have also tried
Expand|Select|Wrap|Line Numbers
  1. [Forms]![racesetupxcf]![RaceTimingSF]![RaceNumber].SetFocus
  2. SendKeys "%ha%n", False
  3. DoCmd.RunCommand acCmdFind
but it also find records all over the form.
The "Look in " option is "greyed out"

please assist
Oct 30 '11 #1
Share this Question
Share on Google+
1 Reply


100+
P: 547
Got it sort off right. One click on the Racenumber field in subform, then press the button with this code, then add number followed by find next
Expand|Select|Wrap|Line Numbers
  1. [Forms]![racesetupxcf]![RaceTimingSF].SetFocus
  2. DoCmd.RunCommand acCmdFind
Oct 30 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.