A family of Microsoft relational database management systems designed for ease of use.
Dear Madoc
I have done a lot of tests of this problem and below are my observation. I am trying to search for a student via his mobile number (8 digit text)
Scenario 1
Account : Microsoft Office 365 Essential or Microsoft office 365 Premium
Product : Microsoft 365 Apps for Business
Under this, my Access will regularly crash when this VBA is run
DoCmd.OpenForm "Registration Edit", acNormal, , "[Mobile] like '*" & Me.txtSearch & "*' "
But the crash is not repeatable. That means, it crashes sometimes, but not the other times. It is especially prone to crash when we first start up the Access program.
I amend the above VBA to :
Dim varX as Variant
varX = DLookup("[ID]", "Registration", "[Mobile] ='" & Me.txtSearch & "'")
DoCmd.OpenForm "Registration Edit", acNormal, , "[ID]=" & varX
No more crash after we change the code.
Scenario 2
Account : Microsoft Office 365 Essential or Microsoft office 365 Premium
Product : Microsoft Office Professional Plus 2019
Under this arrangement, no crash is observed for the 2 sets of VBA codes above.
Thank you for your help. And may you have a good election.