-
WSBart
AskWoody LoungerTake a look at the SQL of your query.
Make sure that it looks like:SELECT DISTINCT field1, field2 etc.
Using DISTINT will filter all duplicate rows out of your results.
Bart
-
WSBart
AskWoody LoungerHi,
Access does not have any tracking possibilities. If you want to track the changes made by users there is only one way to do it right.
Define an extra table and store all information you want to track in that table. This means a lot of work (you have to program additional lines at every point you want to track changes) and a performance loss of your application.
Do not forget to include functionality to delete the extra data in the tracking table once in a while and compress your db regularly.
If you want to thank anyone, thank mister Gates for omitting an essential thing like this in his wonderfull MS Access!Bart
Software Developer -
WSBart
AskWoody LoungerI agree completely with Charlotte.
Program a public function in a public module. You can call that function directly from the afterupdate event in the properties window of any control you want. You call it like this: =fnMyFunctionName()
Note the ‘=’ sign! -
WSBart
AskWoody LoungerUse a query like this:
SELECT tblTest.ID, tblTest.fldDate
FROM tblTest
WHERE (((DateDiff(“y”,CDate(#11/1/00#),[tblTest]![fldDate]))<-184));Bart
Software Designer -
WSBart
AskWoody LoungerIf you can trap the error in your code you can relink the table(s) dynamically.
I use code like this for the relink (sorry comments are dutch):
Set dbs = CurrentDb()
For Each doc In dbs.Containers!tables.Documents
If Not blnGevonden Then
If doc.Name = mstrTabel Then blnGevonden = True Else blnGevonden = False
End If
Next docIf blnGevonden Then
Set tdf = dbs.TableDefs(mstrTabel)
If Len(tdf.Connect) > 0 Then
tdf.Connect = “;DATABASE=” & strExternGegevensBestand
Err = 0
On Error Resume Next
tdf.RefreshLink
‘******************************************************************
‘Als opnieuw connecten niet lukt, stoppen met de handel.
‘******************************************************************
If Err > 0 Then
fnRefreshLink = False
Exit Function
End If
End If
fnRefreshLink = True
Else
‘******************************************************************
‘Tabel niet in database, reconnect onmogelijk.
‘******************************************************************
fnRefreshLink = False
End IfBart
Software Designer -
WSBart
AskWoody LoungerIf the link is established in the front end database, it is stored in the front end database.
If you want to establish referential integrity to your database you should set up the link in the back end database and not in the front end database.Bart Stam
Software designer -
WSBart
AskWoody LoungerUse a recordset (type dynaset) and populate the recordset with the records that have no PIN yet.
SELECT * FROM tblYourTable WHERE PIN Null;
Loop through this recordset and update the records with the new PIN.
Generate the PIN using a counter and check before updating the record whether the new generated PIN already existst. If it exists generate a new PINIn pseudocode
counter = 1
open recordset
while records in recordset
newpin = “PIN-” & cstr(counter)
while exists new pin in database
counter = counter + 1
newpin = “PIN-” & cstr(counter)
loop newpin
update current record with new pin code
counter = counter + 1
next record in recordset
loop recordsetI hope this helps
Bart
Software designer -
WSBart
AskWoody Loungerdim db as database
dim strSQL as string
set db = currentdb()
strSQL = “UPDATE tblYourTable SET fldRownumber = fldRownumber * 10db.execute strSQL, dbFailOnError
set db = Nothing
-
WSBart
AskWoody LoungerHi
I developed a class module to send mails. Comments are in dutch, but the coding speaks for itself:
Option Compare Database
Option Explicit
‘*******************************************************
‘Class clsMAPI
‘*******************************************************
‘Algemene declaraties voor een email object.
‘*******************************************************
Dim objMySes As Object ‘Session object voor de MAPI sessiePublic Function SendMail(txtMailTo As String, Optional txtText As String, Optional txtSubject As String) As String
‘*******************************************************
‘Functie voor het versturen van een mailtje.
‘De returnwaarde is een string.
‘Als de string leeg is is de toevoeging succesvol geweest.
‘Als de string niet leeg is, dan bevat de string een
‘foutboodschap.
‘
‘LAATSTE WIJZIGING:
‘ Versie 1.0 augustus 2000 B. Stam
‘ Initiele versie van de functie
‘*******************************************************
If gTrace Then
Debug.Print “clsMAPI SendMail”
Else
On Error GoTo ErrorHandler
End IfDim strMessage As String
Dim objRecip As Object
Dim objMes As Object‘*******************************************************
‘Ontvanger is verplicht.
‘*******************************************************
If txtMailTo = “” Then
strMessage = “The recipient of the mail is not valid or not given!”
GoTo ExitFunction
End If‘*******************************************************
‘Niet ingevulde parameters afhandelen.
‘*******************************************************
If IsMissing(txtText) Then
txtText = “”
End If
If IsMissing(txtSubject) Then
txtSubject = “”
End If‘*******************************************************
‘De boodschap zelf invullen.
‘*******************************************************
Set objMes = objMySes.Inbox.Messages.Add
With objMes
.Text = txtText
.Subject = txtSubject
End With‘*******************************************************
‘De ontvanger invullen
‘*******************************************************
Set objRecip = objMes.Recipients.Add
With objRecip
.Name = txtMailTo
.Resolve
‘.Send
End With‘*******************************************************
‘En nog even versturen.
‘*******************************************************
objMes.Update
objMes.Send ShowDialog:=FalseExitFunction:
If strMessage “” Then
SendMail = strMessage
Else
SendMail = “”
End If
Exit FunctionErrorHandler:
SendMail = Chr(10) & Chr(13) & “Errornumber: ” & CStr(Err.Number) & ” ”
SendMail = SendMail & “Errormessage: ” & Err.Description
Exit Function
End FunctionPrivate Sub Class_Initialize()
‘*******************************************************
‘Bij het instantieren van het object een MAPI sessie
‘openen.
‘Let op de profilename is afhankelijk van het mail
‘programma dat gebruikt wordt.
‘Als profilename weggelaten wordt, dan wordt er, indien
‘noodzakelijk, automatisch om gevraagd.
‘*******************************************************
If gTrace Then Debug.Print “clsMAPI Class_Initialize”
Set objMySes = CreateObject(“MAPI.Session”)
If Not objMySes Is Nothing Then
objMySes.Logon ‘Als profilename niet gegeven hoeft te worden.
‘objMySes.Logon profileName:=”Microsoft Exchange”
End IfEnd Sub
Private Sub Class_Terminate()
‘*******************************************************
‘Als het object verwijderd wordt ook de MAPI sessie
‘verwijderd.
‘*******************************************************
If gTrace Then Debug.Print “clsMAPI Class_Terminate”
objMySes.Logoff
End SubBart
Software designer -
WSBart
AskWoody LoungerThat was also my solution, but I did not like it. I hoped for a more elegant way to get the function name. Pity….
Thanks for the effort.Bart Stam
Software developer
PGGM Zeist
![]() |
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 |

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
-
Finding Microsoft Office 2021 product key
by
Kathy Stevens
27 minutes ago -
Over-the-Top solves it!
by
RetiredGeek
1 hour, 10 minutes ago -
To Susan – Woody Leonhard, the “Lionhearted”
by
Myst
8 hours, 11 minutes ago -
Extracting Data From All Sheets
by
WSJon5
9 hours, 46 minutes ago -
Use wushowhide in Windows 11 24H2?
by
Tex265
9 hours, 55 minutes ago -
Hacktool:Win32/Winring0
by
Marvel Wars
9 hours, 42 minutes ago -
Microsoft Defender as Primary Security Question
by
blueboy714
10 hours, 22 minutes ago -
USB printers might print random text with the January 2025 preview update
by
Alex5723
12 hours, 25 minutes ago -
Google’s 10-year-old Chromecast is busted, but a fix is coming
by
Alex5723
22 hours, 1 minute ago -
Expand the taskbar?
by
CWBillow
21 hours, 51 minutes ago -
Gregory Forrest “Woody” Leonhard (1951-2025)
by
Susan Bradley
38 minutes ago -
March 2025 updates are out
by
Susan Bradley
9 hours, 56 minutes ago -
Windows 11 Insider Preview build 26120.3380 released to DEV and BETA
by
joep517
1 day, 15 hours ago -
Update Firefox to prevent add-ons issues from root certificate expiration
by
Alex5723
1 day, 22 hours ago -
Latest Firefox requires Password on start up
by
Gordski
1 day, 17 hours ago -
Resolved : AutoCAD 2022 might not open after updating to 24H2
by
Alex5723
2 days, 11 hours ago -
Missing api-ms-win-core-libraryloader-11-2-1.dll
by
IreneLinda
1 day, 10 hours ago -
How Much Daylight have YOU Saved?
by
Nibbled To Death By Ducks
1 day, 13 hours ago -
A brief history of Windows Settings
by
Simon Bisson
1 day, 6 hours ago -
Thunderbolt is not just for monitors
by
Ben Myers
1 day, 5 hours ago -
Password Generators — Your first line of defense
by
Deanna McElveen
1 day, 11 hours ago -
AskWoody at the computer museum
by
Will Fastie
10 hours, 51 minutes ago -
Planning for the unexpected
by
Susan Bradley
1 day, 12 hours ago -
Which printer type is the better one to buy?
by
Bob99
2 days, 13 hours ago -
Upgrading the web server
by
Susan Bradley
2 days, 11 hours ago -
New Windows 11 24H2 Setup – Initial Win Update prevention settings?
by
Tex265
3 days, 6 hours ago -
Creating a Google account
by
DavidofIN
3 days, 5 hours ago -
Undocumented “backdoor” found in Bluetooth chip used by a billion devices
by
Alex5723
3 days, 11 hours ago -
Microsoft Considering AI Models to Replace OpenAI’s in Copilot
by
Alex5723
3 days, 23 hours ago -
AI *emergent misalignment*
by
Alex5723
4 days 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.