Slow performance of .FindRecord

CPGDeveloper

Board Regular
Joined
Oct 8, 2008
Messages
174
Hello~

I administer a db application --MS Access Front End/Azure SQL Back End. The form in question is based on an MS Access Query. I'm having this bizarre issue where I'm using something like this

Dim selid as long
selid = Me.txtSearchID.Value
Me.txtID.SetFocus
DoCmd.FindRecord selid

While the above scenario works to navigate to a specific record, it is painfully slow at times -- upwards of 60 seconds. I have the same speed issue if I'm using a recordset clone as well.

I do notice however, that if I use 'GoToRecord', it is much faster...almost instantaneous:
DoCmd.GoToRecord acDataForm, "MyForm", acGoTo, 7

The problem, of course, is '7' -- that's made up -- I'm trying to figure out how I would determine the proper row number -- something logically along the lines of:

'SELECT rownumber FROM myquery WHERE myid = x'
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Is the field being searched indexed?
Are you loading hundreds of thousands of records into your form (a huge table) instead of filtering the form's records via query instead?
acGoTo, 7 means you're not searching so that makes perfect sense.
 
Upvote 0
Solution
Micron Thanks for your reply -- yes, silly me, I was searching on a non-indexed field. Changing that solves the issue. Thank You!
 
Upvote 0
You're welcome. Note that having too many indexes can slow things down as well. You should only index fields that you'll search on or are required to ensure unique values or combinations of values.
 
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,849
Members
449,194
Latest member
HellScout

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