> Step 4. States "On the data access page, click the command button in the
> header section that corresponds to the recordset that you want to search."
> As I am only searching one database - I presumed this to mean put the
> Command button wherever you want on the Data Access Sheet.
Technically, I think it's telling you to put it in the header section of the
data access sheet, although this may or may not make a difference.
> "Step 6. In the OnClick event of the Find button, add code to clone the
> recordset, to prompt and accept input from the user, and to search the cloned
> recordset for the corresponding record."
> Completely lost! Searched the properties of the Button but could no
> reference to "OnClick" or an "Event".
The "OnClick" event is what happens when a user clicks the button. To code
this, you will need to right-click the button in design view and click Build
(at least this is how it's done in Access forms). That should open up the
Visual Basic window, and from there you can code your Find button.
In my Access form, the code for my Find button looks like this:
Private Sub Find_Click()
On Error GoTo Err_Find_Click
Screen.PreviousControl.SetFocus
DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
Exit_Find_Click:
Exit Sub
Err_Find_Click:
MsgBox Err.Description
Resume Exit_Find_Click
End Sub
As for cloning the recordset, you will probably need to use RecordsetClone.
Try something like this:
Dim rst As Recordset
Set rst = Me.RecordsetClone
To prompt the user for input you can use an InputBox, and to search for the
corresponding record you would use the FindRecord method.
I would suggest checking the Help in VBA for RecordsetClone, InputBox, and
FindRecord. Creating a Find button in an Access form is remarkably easy
(there is actually a wizard to do it), however it sounds like it may be
considerably more difficult for a data access page.
Sorry I couldn't give you something more step-by-step, but hopefully I've at
least given you some useful information.
-Chris
"Niall" wrote:
> Dear one and all,
>
> I NEED step-by-step help to Add a Find Button to a Data Access Sheet I have
> set up for others to review information in a 500+ customer Database.
>
> I am using Access 2003 and believe that "Add a Find button to a data access
> page" http://office.microsoft.com/en-us/as...345491033.aspx
> represents the closest I have gotten to my answer?
>
> Step 4. States "On the data access page, click the command button in the
> header section that corresponds to the recordset that you want to search."
> As I am only searching one database - I presumed this to mean put the
> Command button wherever you want on the Data Access Sheet.
>
> "Step 5. Set the properties of the command button to make it look the way
> you want."
> OK
>
> "Step 6. In the OnClick event of the Find button, add code to clone the
> recordset, to prompt and accept input from the user, and to search the cloned
> recordset for the corresponding record."
> Completely lost! Searched the properties of the Button but could no
> reference to "OnClick" or an "Event".
>
> Please help. Specifically what I am trying to achieve is to have the user
> click on the FIND BUTTON and be brought to a pop-up screen with one field
> where they could enter a text string, hit Enter or press a "go button" and
> have the program search all fields for the text string that was entered and
> return "hits" - one record at a time - with the option to "Find Next" until
> all hits are exhausted. (The same way that the Find Function works when in
> Form View).
>
> Have been at this for a while - "step-by-step" help would be greatly
> appreciated.
>
> Thanks in advance.
>
>
> --
> Niall