Creating a FindRecord Command

ealen

New Member
Joined
Sep 17, 2003
Messages
3
I'm very new with Access and would love some help. I have created a database of client information based on their names, client ID and tax year and details. I have also created an input form for new client information, etc.

What I would like this database to do is when you enter the client ID or the client name, the database automatically finds the client and displays all of their information.

Again, I am very new at this and would appreciate any advice. I have researched the "FindRecord" command and cannot seem to make it work.

Thank you.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
There are a couple of ways you can do this. The first is probably the simplest.
Create an unbound combo box using the wizard.
Choose the third option 'Find a record on my form' etc. etc.
Click next
Select the field or fields.
Click next.
You will now get a preview of the data.
Click next then click finish.
Name you combo box, say cboFindRecord
Now, you need to add some code to the After Update event of the combo box

Sub cboFindRecord_AfterUpdate()
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[PrimaryKeyField] = '" & Me![cboFindRecord] & "'"

Me.Bookmark = Me.RecordsetClone.Bookmark

End Sub

Now when your user makes a selection from the combo box the form will be populated with the rest of the data.

The second way involves QBF or query by form. There is the code for this on the Microsoft web site. It is fairly straighforward. Just follow the steps.

http://support.microsoft.com/default.aspx?scid=kb;en-us;95931&Product=acc97

Hope this helps.

David
 
Upvote 0

Forum statistics

Threads
1,221,574
Messages
6,160,602
Members
451,657
Latest member
Ang24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top