Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Modify Access Find button

BigPete85BigPete85 Member Posts: 30
How do i modify the find command button so it searches criteria from a textbox already on the form, rather then having that built in pop up screen show up and it only searches the textbox that has the focus.

so i type on Peter and July in two different textboxes and it will jump to the record where the name is Peter and the date is July.

Comments

  • dokken2dokken2 Member Posts: 532
    : How do i modify the find command button so it searches criteria from a textbox already on the form, rather then having that built in pop up screen show up and it only searches the textbox that has the focus.
    :
    : so i type on Peter and July in two different textboxes and it will jump to the record where the name is Peter and the date is July.
    :


    find for a specific textbox, set the focus-
    [code]
    Me.Text0.SetFocus 'set focus to textbox with search string
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70 'find-rec
    [/code]

    find a textbox and put textbox text into find dialog-
    [code]
    Me.Text0.SetFocus 'set focus to textbox with search string
    SendKeys "^c" 'ctrl+c - copy
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70 'find-rec
    SendKeys "^v" 'ctrl+v - paste in find dialog
    [/code]
Sign In or Register to comment.