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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

search line please

Status
Not open for further replies.

jewel

Technical User
May 23, 2001
158
NZ
hi all

I have set up the normal search command button but want to add a line in (I will only ever be searching from this field)

Private Sub findrecord_Click()
On Error GoTo Err_findrecord_Click


Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_findrecord_Click:
Exit Sub

Err_findrecord_Click:
MsgBox Err.Description
Resume Exit_findrecord_Click

End Sub
"Subject" field - has text up to 100 characters

so line to read as normal search eg either part or full but I want to code it in rather than clicking into the field and going search - after which line do I add it.

cheers
Dianne :)
 
Not really sure, but I don't think you have any control over the actual menu item.

1. Try using * wild card (?)
2. I always use the Find function in VBA. Total control <g>.

Regards
BrianB
** Let us know if you get something that works !
================================
 
If I've read your question right, you've got the search OK, but you want it to search one specific field every time, not the last clicked in?

If that is the case, replace:

Screen.PreviousControl.SetFocus

Which sets the focus to the field clicked b4 the find button to:

requiredcontrolname.setfocus

I think.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top