Run time error on code that was previously running fine (1 Viewer)

cowenpa

Member
Local time
Today, 21:42
Joined
Apr 7, 2021
Messages
38
I am getting
1621400280721.png

When I try and update recordsource on a subform from VBA - it was working fine yesterday and now not working
If I use the same SQL and set it manually it works fine on the subform

also happens on lines like this
Set frm = Me.FrmMonthDeptQuery.Form
which worked fine before - the form name has not changed or anything

Any advice?

Thanks

Paul
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:42
Joined
Feb 28, 2001
Messages
27,192
This is Tuesday. The typical Microsoft "update" cycles run on Tuesday (by long-standing tradition). If you are on Windows 10 then try Start >> Settings >> Windows Update >> Update History and see if you got patched in the last 24 hours. If so, you got caught on a library change/patch.

The second thing to try to do is to open the project in the manner of a designer / maintainer. Go to the VBA code page. From the menu bar follow Tools >> References and see if any of the checked references are MISSING or BROKEN (those words would appear on the line if either was true.)

What you describe is typical behavior of a busted library reference. The only other possibility is that someone was meddling and messed up some of your code. There, can't help you because only you are likely to recognize your own code.
 

conception_native_0123

Well-known member
Local time
Today, 15:42
Joined
Mar 13, 2021
Messages
1,834
What you describe is typical behavior of a busted library reference.

you mean the internal pointer changed? as in, the loc of the lib? if so, why would that change with a simple update via the update scheduler in windows? isn't that only prone to happen when versionings of office products change?
 

cowenpa

Member
Local time
Today, 21:42
Joined
Apr 7, 2021
Messages
38
This is Tuesday. The typical Microsoft "update" cycles run on Tuesday (by long-standing tradition). If you are on Windows 10 then try Start >> Settings >> Windows Update >> Update History and see if you got patched in the last 24 hours. If so, you got caught on a library change/patch.

The second thing to try to do is to open the project in the manner of a designer / maintainer. Go to the VBA code page. From the menu bar follow Tools >> References and see if any of the checked references are MISSING or BROKEN (those words would appear on the line if either was true.)

What you describe is typical behavior of a busted library reference. The only other possibility is that someone was meddling and messed up some of your code. There, can't help you because only you are likely to recognize your own code.
No recent updates - last was end of April and I already checked for broken or missing references. Nobody else would have tampered with it as it's only locally on my laptop at this point

I'll try recreating the database and see if get same issue there - bloody Microsoft

Paul
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:42
Joined
Feb 28, 2001
Messages
27,192
Does a Compact & Repair help?

You see, the thing that makes this tricky is that what you described doesn't happen with computers. Something has to have changed. Things that have worked for some period longer than just a day or two will not stop working without reason. So the trick is to discover the reason. Find out what changed.
 

cowenpa

Member
Local time
Today, 21:42
Joined
Apr 7, 2021
Messages
38
I have created a new database and imported in the database and forms and relevant queries and worked first time - the only thing I can think of is that I created a new form with a slighly similar name to an existing one - nothing else changed. Most likely it is corruption going by other posts on the same error - some suggested recreating (as I have done) and others using command line tools to check the database. A repair may do the job - may try that.

I'm back in action and stuck with another issue which I just posted in forms - time for a rest and will pick it up again later or tomorrow.
 

Users who are viewing this thread

Top Bottom