Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Find defaults ALSO next record

Status
Not open for further replies.

Evelyn

Technical User
Apr 17, 2000
4
US
Can you please tell me know to change the Find defaults.  The "look in" and "match".  When I do a find I want to search entire form not one field and also want to always match the start of field not the whole field.  THANKS.  Also, when doing a form if you don't enter the entire form and end in the middle, is there an easy way to get to the next new record, first field without hitting next at bottom and putting cursor in first field?
 
Unfortunately, I have never found a way to do what you want, short of writing code to do the find for me.&nbsp;&nbsp;Put a text box on your form, probably in the header or the footer, and add a command button with a caption of Find.&nbsp;&nbsp;You can use the FindRecord method, I think, to do your searching and using Find, you can set all your options.<br><br>As to your second question, again I don't see how to do it without using a command button that will have code behind it to go to the next record and set the focus to the first field.<br><br>Kathryn
 
Dear Kathryn put this code on the &quot;on click event&quot; of a form
i hope this helps

On Error GoTo Err_Command45_Click
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
SendKeys &quot;%o&quot;, True
Exit_Command45_Click:
Exit Sub

Err_Command45_Click:
MsgBox Err.Description
Resume Exit_Command45_Click

'Other options, if the option is already turned on, a sendkeys can turn it off.
'To specify Find What:SendKeys &quot;%n<string to find>&quot;, True
'Search Up:SendKeys &quot;%cu&quot;, True
'Search Down:SendKeys &quot;%cd&quot;, True
'Match Start of Field:SendKeys &quot;%hs&quot;
'Match Any part of Field:SendKeys &quot;%ha&quot;, True
'Match Case:SendKeys &quot;%c&quot;, True
'Search Fields as Formatted:SendKeys &quot;%o&quot;, True
'Search only current field:SendKeys &quot;%e&quot;, True
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top