J
JRF
Hello and thank you for your valued advice.
Access 2003
Win 2K OS
I am attempting to duplicate the effects "in code" of Find and Replace, from
the Find and Replace feature within Access, specifically the Find Next
portion of the Find and Replace dialog box.
I have a form, FormA, which is bound to a table, Table1. On FormA, I
frequently do a search on one field, Field1, using the Find and Replace
feature, which is called from a command button, Button1. With Field1
highlighted, Button1 is clicked to open the Find and Replace dialog box, the
Field1 value is automatically populated to this box. I click Find Next and
when a matching record is found for Field1, the remainder of the FormA
fields populate with that matching record data.
I have now put into this form, FormA, a "Refresh" command button which I
want to perform the same function as the Find Next portion of the Find and
Replace feature, without the dialog box. My intention is to eliminate the
display of the Find and Replace dialog box, yet, achieve the same results
through code by Clicking the new Refresh command button.
I have attempted some coding on my own using Findnext and GotoRecord and
cannot seem to accomplish what I am looking for, though I will continue to
look. I think I need some way of keeping the binding to the form through
recordsets when the search value is found, at least that is the direction I
am currently pursuing. I could use to guidance, thank you.
Proccess in current live sequence:
Enter my search value in Field1 of FormA
Click Button1, Find and Replace dialog opens, Field1 value is populated to
dialog box
Click Find Next
Value is found and populates remainder fields of FormA.
Desired Sequence:
Enter my search value in Field1 of FormA
Click "Refresh" button
Field1 value is searched, found, and populates fields of FormA.
** Current Code for Button1
Private Sub Search_Click()
On Error GoTo Err_Search_Cl
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_Search_Cl:
Exit Sub
Err_Search_Cl:
Errorroutine
Resume Exit_Search_Cl
End Sub
Access 2003
Win 2K OS
I am attempting to duplicate the effects "in code" of Find and Replace, from
the Find and Replace feature within Access, specifically the Find Next
portion of the Find and Replace dialog box.
I have a form, FormA, which is bound to a table, Table1. On FormA, I
frequently do a search on one field, Field1, using the Find and Replace
feature, which is called from a command button, Button1. With Field1
highlighted, Button1 is clicked to open the Find and Replace dialog box, the
Field1 value is automatically populated to this box. I click Find Next and
when a matching record is found for Field1, the remainder of the FormA
fields populate with that matching record data.
I have now put into this form, FormA, a "Refresh" command button which I
want to perform the same function as the Find Next portion of the Find and
Replace feature, without the dialog box. My intention is to eliminate the
display of the Find and Replace dialog box, yet, achieve the same results
through code by Clicking the new Refresh command button.
I have attempted some coding on my own using Findnext and GotoRecord and
cannot seem to accomplish what I am looking for, though I will continue to
look. I think I need some way of keeping the binding to the form through
recordsets when the search value is found, at least that is the direction I
am currently pursuing. I could use to guidance, thank you.
Proccess in current live sequence:
Enter my search value in Field1 of FormA
Click Button1, Find and Replace dialog opens, Field1 value is populated to
dialog box
Click Find Next
Value is found and populates remainder fields of FormA.
Desired Sequence:
Enter my search value in Field1 of FormA
Click "Refresh" button
Field1 value is searched, found, and populates fields of FormA.
** Current Code for Button1
Private Sub Search_Click()
On Error GoTo Err_Search_Cl
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_Search_Cl:
Exit Sub
Err_Search_Cl:
Errorroutine
Resume Exit_Search_Cl
End Sub