I have splitted up my time clock program into a FE BE and it works fine with one exception the forms are very slow and I’m going to have to blame the dlookup function. OI would like to know if there is a way to spped up the lookup on my form by replacing dlookup with a recordset call. However I’m not sure how to go about it.
The following line of code is on the form:
If IsNull(DLookup(“[AssID]”, “tblAssociateInfo”, “[AssID]= ” & Me.txtAssID.Value & “”)) Then
Me.chkID.Value = Me.chkID.Value + 1
If Me.chkID.Value > 3 Then
MsgBox “You may not make more than three User ID entry attempts.”, vbCritical + vbOKOnly, “Security Violation!”
DoCmd.Quit
End If
My goal is to look up an id and if it exsist the let the user continue, if it doesn’t record the number of attemps and after 3 failed attemps shutdown th db. Again the code works the way I want it to I just want to speed up the opening of the form and speed of the lookup.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Improve Dlookup Speed (ACC 2002)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Improve Dlookup Speed (ACC 2002)
- This topic has 13 replies, 5 voices, and was last updated 20 years, 6 months ago.
AuthorTopicWSunpuertomex
AskWoody LoungerOctober 7, 2004 at 5:31 am #1771493Viewing 4 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerOctober 7, 2004 at 5:41 am #1808516I don’t know if using a recordset will be faster, but it won’t hurt to try.
Set a reference to the Microsoft DAO 3.6 Object Library (Tools | References…)
The code could look like this:Dim dbs As DAO.Database
Dim rst As DAO.RecordsetSet dbs = CurrentDb
Set rst = dbs.OpenRecordset(“tblAssociateInfo”, dbOpenDynaset)
…
rst.FindFirst “[AssID] = ” & Me.txtAssID
If rst.NoMatch = True Then
‘ not found
…
End If
…
rst.Close
Set rst = Nothing
Set dbs = NothingFor reasons of efficiency, it is best not to open and close the recordset for each entry attempt, but to set it at the beginning, and to keep it open until it is no longer needed.
-
WSunpuertomex
AskWoody Lounger
-
-
WBell
AskWoody_MVPOctober 7, 2004 at 7:08 am #1808522You should be aware that the approach you are taking to register users isn’t very secure. You could of course prevent bypassing the startup key, but there isn’t anything to prevent a user from opening the backend and reading the tblAssociateInfo and getting the ID (and password presumably) and logging in. If you are concerned about those issues, then you should explore the Access User Security feature.
As a method of speeding up performance, you might consider putting the table you are working with in the Front-End rather than the Back-End. We often do that with small tables that are relatively static. It can however be a pain if you have a number of users with the FE deployed to each workstation and you need to update it. If that’s an issue here post back and we can make some suggestions.
-
WSunpuertomex
AskWoody LoungerOctober 7, 2004 at 10:39 pm #1808645Thought about using Access security. However I keep hearing that the workgroup needs to be kept with the mdb, if this is the case the user can bypass (over write) the workgroup and have admin access to the file regardless. Is this a fact?
To your point the issue with keeping the table on the FE is the maintenance (large turn over).
Nevertheless I’m open to all suggestion in improving this program. -
WSHansV
AskWoody LoungerOctober 7, 2004 at 11:08 pm #1808647If you set up user-level security properly, the admin user can do little or nothing in the database, so bypassing the secured workgroup file will not work. See WendellB‘s tutorial The Secrets of Security. It contains many useful links. Another good tutorial can be found on jacksonmacd‘s website (first link).
-
WBell
AskWoody_MVPOctober 7, 2004 at 11:25 pm #1808649Hans’ response is correct – a properly secured database can only be opened by a person who is using the correct .MDW file, and is authorized by userid and password to open the database. There isn’t a three-strikes and you are out facility, so people can try repeatedly, but a resonably complex password will make it quite difficult to hack. The documents Hans suggested should give you a decent feel for the subject, and our tutorial includes references to a number of Microsoft articles that are quite useful as well.
The usual problem people have with applying security is that they don’t follow all the steps – it’s relatively complex with 13 to 15 steps depending on the source document you read, but the Security Wizard will do a fair bit of it for you. One of the more valuable side benefits is that you can track who made changes using form events.
As to the turn-over issue, then you will probably want to locate the .MDW file on the server so you only have to change one copy, though that may cause some performance issues during the login process, but once that’s been done, it should be responsive. If you have lots of simultaneous users, you may want to look at a deployment manager that will copy new versions of both the FE and the MDW file down to the local hard drive on the workstation.
-
WSunpuertomex
AskWoody LoungerOctober 8, 2004 at 3:42 am #1808665
-
-
-
-
WSStewart
AskWoody LoungerOctober 7, 2004 at 11:20 am #1808532(Edited by HansV to make URLs clickable – see Help 19)
have a look at these replacement functions for the Dlookup and other domain aggregate functions.
I have not used them but they may help.
http://easyweb.easynet.co.uk/~trevor/AccFA…ules.htm#doamin%5B/url%5D
also some tips to make access faster can be found at
-
WSMarkLiquorman
AskWoody Lounger -
WSMarkLiquorman
AskWoody LoungerOctober 8, 2004 at 3:50 pm #1808698Oops, got distracted and posted the last message before I had a chance to finish it.
As I was saying, I can’t see how 1 DLookup will make your forms run slow. Poor form performance is usually caused by 1 or more of the following factors:
– Large recordsets for bound forms.
– Many subforms with large recordsets.
– Name autocorrect is ON.
– Subdatasheets haven’t been removed.
– Lack of indexes on sorted/searched fields.
-
WSunpuertomex
AskWoody LoungerOctober 9, 2004 at 12:28 am #1808748It wasn’t one Dlookup is was 2 of them and only on one form. To test my assumption I made a copy of the form. I then ran it several times and averaged the time of the form with the Dlookup, then I did the same thing with the one with the recordset call. So, for what ever reason the form with the recordset call always ran faster then the Dlookup. This may not be the most scientific way of testing performance, but it sure works well for a poorman.
-
WSMarkLiquorman
AskWoody LoungerOctober 9, 2004 at 1:54 am #1808759Well, your original message said “…the forms are very slow and I’m going to have to blame the dlookup function.” So from this I gathered there was as issue with multiple forms.
Regardless, whether it is 1 Dlookup or 2 of them, I doubt that it would make any sort of meaningful difference using dlookup vs a recordset.
-
WSunpuertomex
AskWoody Lounger
-
-
-
Viewing 4 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
4 hours, 48 minutes ago -
Creating an Index in Word 365
by
CWBillow
4 hours, 53 minutes ago -
Coming at Word 365 and Table of Contents
by
CWBillow
4 hours, 58 minutes ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
9 hours, 54 minutes ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
13 hours, 20 minutes ago -
W11 24H2 – Susan Bradley
by
G Pickerell
15 hours, 16 minutes ago -
7 tips to get the most out of Windows 11
by
Alex5723
13 hours, 17 minutes ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
6 hours, 38 minutes ago -
I installed Windows 11 24H2
by
Will Fastie
35 minutes ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
18 hours, 43 minutes ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
1 hour, 45 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
1 day, 2 hours ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
11 hours, 10 minutes ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
11 hours, 24 minutes ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
1 day, 20 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
2 days, 4 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
1 day, 6 hours ago -
Mail from certain domains not delivered to my outlook.com address
by
pumphouse
1 day, 12 hours ago -
Is data that is in OneDrive also taking up space on my computer?
by
WShollis1818
1 day, 23 hours ago -
Nvidia just fixed an AMD Linux bug
by
Alex5723
3 days, 15 hours ago -
50 years and counting
by
Susan Bradley
13 hours, 35 minutes ago -
Fix Bluetooth Device Failed to Delete in Windows Settings
by
Drcard:))
16 hours, 23 minutes ago -
Licensing and pricing updates for on-premises server products coming July 2025
by
Alex5723
4 days, 2 hours ago -
Edge : Deprecating window.external.getHostEnvironmentValue()
by
Alex5723
4 days, 2 hours ago -
Rethinking Extension Data Consent: Clarity, Consistency, and Control
by
Alex5723
4 days, 2 hours ago -
OneNote and MS Word 365
by
CWBillow
4 days, 4 hours ago -
Ultimate Mac Buyers Guide 2025: Which Mac is Right For You?
by
Alex5723
4 days, 4 hours ago -
Intel Unison support ends on Windows 11 in June
by
Alex5723
4 days, 4 hours ago -
April 2025 — still issues with AMD + 24H2
by
Kevin Jones
1 day, 20 hours ago -
Windows 11 Insider Preview build 26200.5518 released to DEV
by
joep517
4 days, 16 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.