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, 8 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 LoungerWSMarkLiquorman
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
-
Plugged in 24-7
by
CWBillow
3 minutes ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
20 minutes ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
11 hours ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
1 day, 15 hours ago -
Are Macs immune?
by
Susan Bradley
11 hours, 12 minutes ago -
HP Envy and the Function keys
by
CWBillow
23 hours, 13 minutes ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
2 days, 2 hours ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
2 days, 3 hours ago -
Unable to update to version 22h2
by
04om
17 hours, 34 minutes ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
2 days, 10 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
2 days, 10 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
1 day, 20 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
2 days, 23 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
2 days, 12 hours ago -
Is your battery draining?
by
Susan Bradley
23 hours, 32 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
32 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
3 days, 3 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
13 hours, 27 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
2 days, 11 hours ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
2 days, 4 hours ago -
National scam day
by
Susan Bradley
1 day, 10 hours ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
2 days, 7 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
4 days, 4 hours ago -
Tools to support internet discussions
by
Kathy Stevens
2 days, 17 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
3 days, 19 hours ago -
AI is good sometimes
by
Susan Bradley
4 days, 11 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
4 days, 1 hour ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
5 days, 11 hours ago -
June KB5060842 update broke DHCP server service
by
Alex5723
5 days, 10 hours ago -
AMD Ryzen™ Chipset Driver Release Notes 7.06.02.123
by
Alex5723
5 days, 14 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.