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, 7 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
-
Flash Drive Eject Error for Still In Use
by
J9438
3 minutes ago -
Windows 11 Insider Preview build 27863 released to Canary
by
joep517
16 hours, 33 minutes ago -
Windows 11 Insider Preview build 26120.4161 (24H2) released to BETA
by
joep517
16 hours, 34 minutes ago -
AI model turns to blackmail when engineers try to take it offline
by
Cybertooth
9 hours, 18 minutes ago -
Migrate off MS365 to Apple Products
by
dmt_3904
44 minutes ago -
Login screen icon
by
CWBillow
7 hours, 58 minutes ago -
AI coming to everything
by
Susan Bradley
16 hours, 44 minutes ago -
Mozilla : Pocket shuts down July 8, 2025, Fakespot shuts down on July 1, 2025
by
Alex5723
1 day, 8 hours ago -
No Screen TurnOff???
by
CWBillow
1 day, 8 hours ago -
Identify a dynamic range to then be used in another formula
by
BigDaddy07
1 day, 9 hours ago -
InfoStealer Malware Data Breach Exposed 184 Million Logins and Passwords
by
Alex5723
1 day, 20 hours ago -
How well does your browser block trackers?
by
n0ads
1 day, 7 hours ago -
You can’t handle me
by
Susan Bradley
7 hours ago -
Chrome Can Now Change Your Weak Passwords for You
by
Alex5723
23 hours, 39 minutes ago -
Microsoft: Over 394,000 Windows PCs infected by Lumma malware, affects Chrome..
by
Alex5723
2 days, 8 hours ago -
Signal vs Microsoft’s Recall ; By Default, Signal Doesn’t Recall
by
Alex5723
1 day, 11 hours ago -
Internet Archive : This is where all of The Internet is stored
by
Alex5723
2 days, 8 hours ago -
iPhone 7 Plus and the iPhone 8 on Vantage list
by
Alex5723
2 days, 8 hours ago -
Lumma malware takedown
by
EyesOnWindows
1 day, 20 hours ago -
“kill switches” found in Chinese made power inverters
by
Alex5723
2 days, 17 hours ago -
Windows 11 – InControl vs pausing Windows updates
by
Kathy Stevens
2 days, 17 hours ago -
Meet Gemini in Chrome
by
Alex5723
2 days, 21 hours ago -
DuckDuckGo’s Duck.ai added GPT-4o mini
by
Alex5723
2 days, 21 hours ago -
Trump signs Take It Down Act
by
Alex5723
3 days, 5 hours ago -
Do you have a maintenance window?
by
Susan Bradley
1 day, 10 hours ago -
Freshly discovered bug in OpenPGP.js undermines whole point of encrypted comms
by
Nibbled To Death By Ducks
2 days, 7 hours ago -
Cox Communications and Charter Communications to merge
by
not so anon
3 days, 8 hours ago -
Help with WD usb driver on Windows 11
by
Tex265
19 hours, 59 minutes ago -
hibernate activation
by
e_belmont
3 days, 17 hours ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
3 days, 21 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.