-
WSJayden
AskWoody LoungerIf you do have multiple records on a page, instead of using the On Format event of the page, use the On Format event of the Detail section (right click the detail bar in design view of the report, select properties, click the event tab and you should see the On Format event).
-
WSJayden
AskWoody LoungerI would tend to use the cdate() function rather than the format() function (although the format function does work)
Just as an alternative really I guess
cdate(Mid$([FullLineField],25,6))
Cheers
Jayden
-
WSJayden
AskWoody LoungerI’d say that your ‘Invalid Use of Null’ error is occuring when you try to set your ‘field9’ variable (and the value in the rs.field(“Ct-St-Zip”) is null).
To alleviate this you could change the line to
Field9 = Trim(Nz(Rs.Fields(“Ct-St-Zip”), “”))
This type of error shouldn’t occur on the lines for variables field2-8 because you have actually declared these variables as variants rather than strings.
Dim Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9 As string
In the above line you are only setting Field9 to a string variable, and the rest of the variables to the type ‘variant’. This is why you wouldn’t get an error on fields2-8 (because a variant data type can hold a null value).
You need to explicitly sate the variable type for each variable even if they are on the same line… ie.
Dim Field2 as String, Field3 As String, Field4 As String, Field5 As String, Field6 As String, Field7 As String, Field8 As String, Field9 As String
Cheers
Jayden
-
WSJayden
AskWoody LoungerYay,
Your comments got me thinking (especially about the Recordsetclone causing the Current Event to fire)…so I then found the problem / cause of my query, thanks. It is certainly the Recordsetclone that is causing Access to run the Current Event again, then return to the place where it left off (thereby giving the double ‘CurrentFinish’). This may certainly explain some of the record locking issues.
You’ve been a great help, thanks.
PS: I would never have though that Access would ‘nest’ a Current Event within another Current Event so to speak….don’t we learn something everyday!
Cheers
Jayden
-
WSJayden
AskWoody LoungerHi
This one has me stumped. To cut a long story short, I am having locking issues in an Access database that two users are using at the same time. I can’t seem to find the reason that records are locking, there don’t seem to be any places where they should be being locked. Investigating this problem led me to look at what is happening during the OnCurrent and BeforeUpdate events of the data entry form.
The databases that users are using are distributed MDE files (with linked tables back to a central .mdb file).
In order to try and figure out what is happening between the both of them, at various stages during the OnCurrent and BeforeUpdate routines, I write information to table to try and track where each user is at when the locking occurs.
I’ve noticed however that Access is ‘repeating’ parts of code that are NOT part of a loop (without repeating the parts of code the preceed them. Here is some output from the table that I am writing to.
Only one user (charlotteb) is logged into the database when this is happening.
User Position TimeStamp Order CharlotteB CurrentFinish 25/10/2001 17:02:21 31209 CharlotteB CurrentFinish 25/10/2001 17:02:21 31208 CharlotteB Current3 25/10/2001 17:02:21 31207 CharlotteB Current2 25/10/2001 17:02:21 31206 CharlotteB Current 25/10/2001 17:02:21 31205 This table is showing the output from a function in reverse order (ie. the most recent event at the top).
Notice how the ‘CurrentFinish’ output follows itself twice (without the Current1, 2, 3 etc).
Next I will paste the event subroutine that is writing to the table
———————————————————————————————————-
Private Sub Form_Current()
Dim tempRecBookmark As LongDebugLog “Current” ‘Degugger for LockedRecords
If IsNull(Me![cboProviderID]) Then
bExistingRecord = False
‘Me![cboProviderID].Locked = False
Else
bExistingRecord = True
‘Me![cboProviderID].Locked = True
End IfDebugLog “Current2” ‘Degugger for LockedRecords
If IsNull(Me![cboDisallowedReason]) Then
Me![txtPSDate].Visible = False
Else
Me![txtPSDate].Visible = True
End IfDebugLog “Current3” ‘Degugger for LockedRecords
‘ this is for going back to the disallowed claim that you just entered
‘ in the beforeUpdate event of the form, assign the [claimID] to lngdisallowRecID
If lngdisallowRecID 0 Then
DebugLog “Current4” ‘De###### for LockedRecords
tempRecBookmark = lngdisallowRecID
lngdisallowRecID = 0
Me.RecordsetClone.FindFirst “[ClaimID] = ” & tempRecBookmark
Me.Bookmark = Me.RecordsetClone.Bookmark
End IfDebugLog “CurrentFinish” ‘Degugger for LockedRecords
End Sub
——————————————————————————————————-At various points in the subroutine, you will notice that the subroutine calls a function ‘DebugLog’ and passes a string variable. This function writes one line (using DAO) to the table shown above.
Note how it is theoretically impossible for the line ‘CurrentFinish’ to be written twice in a row.
I have no answers for this – and I suspect that Access is doing something that it shouldn’t be. Has anyone got any insight, or experienced something similar?
Your help or opinions are much appreciated.
Cheers
Jayden
Access 2000 SR-2
Jet4 SP5 -
WSJayden
AskWoody LoungerHI Charlotte,
Thanks for the comments. I completely agree with you. I also apologise for it being hard to follow.
I guess the 2 points that I make are
1. Notce in the table of records that I presented the CurrentFinish string is written to the table two records in a row
2. If the OnCurrent event was firing twice in a row, it would still have to run through the sections of the OnCurrent Event that write Current, Current2, Current3 to the table before it could write CurrentFinish. It doesn’t perform the parts of the OnCurrent Event that it should prior to the ‘CurrentFinish’ stage.
Cheers
Jayden
-
WSJayden
AskWoody LoungerMy solution may not be the most elegant, but it works
1. In the table that contains the data create a new ‘yes/no’ field (called it something like ‘FLAG’)
2. Create a new module
3. Add the following Code to the module (replace the , and with the names of the table you wish to search and the field you wish to search and use as the flag.
4. Run this routine. VIOLA, all the fields that have an * at the end of them are CHECKED TRUE in the flag field!
Sub SearchAst()
Dim rstSearchTable As Recordset
Dim strFieldSearch As String
Dim strFieldFlag As StringSet rstSearchTable = CurrentDb.OpenRecordset(“”, dbopentable)
strFieldSearch = “”
strFieldFlag = “”With rstSearchTable
Do While Not .EOF
If Right(.Fields(strFieldSearch), 1) = “*” Then
.edit
.Fields(strFieldFlag) = True
.Update
End If
.MoveNext
Loop
End With
End Sub -
WSJayden
AskWoody LoungerYou are a genius! Thanks, I can’t believe that it was in front of me the whole time.
![]() |
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
-
9 Surprisingly Effective Ways To Tonic Greens (Awaiting moderation)
by
joannnall9452
1 hour, 40 minutes ago -
advice for setting up a new windows computer
by
routtco1001
5 hours, 58 minutes ago -
It’s Identity Theft Day!
by
Susan Bradley
2 hours, 37 minutes ago -
Android 15 require minimum 32GB of storage
by
Alex5723
10 hours, 48 minutes ago -
Mac Mini 2018, iPhone 6s 2015 Are Now Vintage
by
Alex5723
10 hours, 57 minutes ago -
Hertz says hackers stole customer credit card and driver’s license data
by
Alex5723
11 hours, 28 minutes ago -
Firefox became sluggish
by
Rick Corbett
8 hours, 22 minutes ago -
Windows 10 Build 19045.5794 (22H2) to Release Preview Channel
by
joep517
15 hours, 26 minutes ago -
Windows 11 Insider Preview Build 22635.5235 (23H2) released to BETA
by
joep517
15 hours, 55 minutes ago -
A Funny Thing Happened on the Way to the Forum
by
bbearren
11 hours, 26 minutes ago -
Download speeds only 0.3Mbps after 24H2 upgrade on WiFi and Ethernet
by
John
12 hours, 49 minutes ago -
T-Mobile 5G Wireless Internet
by
WSmmi16
4 hours, 47 minutes ago -
Clock missing above calendar in Windows 10
by
WSCape Sand
5 hours, 21 minutes ago -
Formula to Calculate Q1, Q2, Q3, or Q4 of the Year?
by
WSJon5
1 day, 6 hours ago -
The time has come for AI-generated art
by
Catherine Barrett
10 hours, 44 minutes ago -
Hackers are using two-factor authentication to infect you
by
B. Livingston
20 hours, 25 minutes ago -
23 and you
by
Max Stul Oppenheimer
1 day, 3 hours ago -
April’s deluge of patches
by
Susan Bradley
6 hours, 58 minutes ago -
Windows 11 Windows Updater question
by
Tex265
7 hours, 26 minutes ago -
Key, Key, my kingdom for a Key!
by
RetiredGeek
2 days, 12 hours ago -
Registry Patches for Windows 10
by
Drcard:))
2 days, 17 hours ago -
Cannot get line length to NOT wrap in Outlining in Word 365
by
CWBillow
1 day, 23 hours ago -
DDU (Display Driver Uninstaller) updates
by
Alex5723
1 day, 8 hours ago -
Align objects on a OneNote page
by
CWBillow
2 days, 22 hours ago -
OneNote Send To button?
by
CWBillow
2 days, 23 hours ago -
WU help needed with “Some settings are managed by your organization”
by
Peobody
3 days, 7 hours ago -
No Newsletters since 27 January
by
rog7
1 day, 12 hours ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
2 days, 8 hours ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
2 days, 6 hours ago -
Google One Storage Questions
by
LHiggins
1 day, 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.