"No current record" error now affecting all versions of my database (1 Viewer)

zebrafoot

Member
Local time
Today, 10:16
Joined
May 15, 2020
Messages
48
Hi.
I hope this is a quick one!

I've made a split database for the company I work for. We have started using it and I decided to make some changes in order to streamline the forms, so did so on a local copy of the front end, with my data tables coming from a copy of the tables as linked data. I noticed some unusual behaviour including an error "No current record" and assumed that this was a direct result of my changes, so I've spent a while trying to find out what was going wrong. Long story short, although my boss is able to use the database (front end on his computer, linked files on a server somewhere else), I'm getting the same error as I was before. Infuriatingly, the error seems to persist even when I use the same version of the front end he is using, copied to my machine, or an old and previously stable version that was working ok last week. Ditto the tables; the current live dataset, copied to my machine doesn't work, neither do older versions.

The only thing that I can imagine would be causing this is that some setting on Access, or an update or change to my version of Windows could be causing the error, but as far as I am aware I haven't changed anything. If anyone can offer any suggestion of likely causes to investigate, I will be extremely grateful.

Cheers,
Pete
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:16
Joined
Feb 28, 2001
Messages
22,514
Need to clarify something.

Are you saying that on YOUR machine, both the new and an older version of the FE both fail with the same error, but your boss's machine can run the code with no problem?

If so, look for differences in permissions and also check for Windows updates having occurred asymmetrically - on yours but not on his. Also Office updates.
 

Auntiejack56

Registered User.
Local time
Today, 19:16
Joined
Aug 7, 2017
Messages
142
Are you getting any records at all, or just occasional 'No current record' messages?
In case the problem is the linkage, try deleting all your table links, then importing the tables into your front end. If that solves the problem, then you'll need to check whether there is a relinking function that is running automatically and not getting the connection right.
Can you open all the tables directly from the FE on your machine?
 

zebrafoot

Member
Local time
Today, 10:16
Joined
May 15, 2020
Messages
48
Hi The_Doc_Man,

Many thanks for your reply. That is exactly what I meant initially, but I've just been in touch with him and it seems that he is also seeing the same behaviour, but less frequently than I do. After a bit of further testing, I can also add that the error can be "no current record", "property not found" or "the search key was not found in any record" - these seem to be somewhat interchangeable (it's a lucky dip which I see when I restart the database), being triggered by the same button presses.

Summary:
Forms were working error-free up to Thursday last week
New errors appearing ("no current record", "property not found", "the search key was not found in any record") as of today
Other versions of the FE and tables that didn't previously give these errors now do.
 

Minty

AWF VIP
Local time
Today, 10:16
Joined
Jul 26, 2013
Messages
9,237
Assuming this is an access backend file, it sounds like it is suffering from poor connectivity.

Alternatively, make sure that all the updates have been made to office and are completed.
Finally make a copy of the back end, plonk it on your machine and relink your FE to that - do you get the same errors?
 

zebrafoot

Member
Local time
Today, 10:16
Joined
May 15, 2020
Messages
48
Are you getting any records at all, or just occasional 'No current record' messages?
In case the problem is the linkage, try deleting all your table links, then importing the tables into your front end. If that solves the problem, then you'll need to check whether there is a relinking function that is running automatically and not getting the connection right.
Can you open all the tables directly from the FE on your machine?
Thanks for your reply. It's a couple of actions that I do that trigger the error, but the data display ok as far as I can see. I've already done the relinking as you suggest, so pretty sure it's not that. All databases open directly from FE, yes.

Pete
 

zebrafoot

Member
Local time
Today, 10:16
Joined
May 15, 2020
Messages
48
Assuming this is an access backend file, it sounds like it is suffering from poor connectivity.

Alternatively, make sure that all the updates have been made to office and are completed.
Finally make a copy of the back end, plonk it on your machine and relink your FE to that - do you get the same errors?
Hi Minty,

I'll check the office updates now. Yes, I've copied the back end from our remote server to my computer and I'm still getting the same issue when I link to those files.
 

jdraw

Super Moderator
Staff member
Local time
Today, 05:16
Joined
Jan 23, 2006
Messages
14,247
I've copied the back end from our remote server to my computer and I'm still getting the same issue when I link to those files.
Perhaps it's time to make copies and post with just enough data to show the issue. We don't need all your data - only enough (even mock data) to highlight the issue.

If the issue still occurs when you put FE and BE on your local PC, I can't see how connectivity is the issue.
 

Minty

AWF VIP
Local time
Today, 10:16
Joined
Jul 26, 2013
Messages
9,237
Can you outline the changes you made?
If it was working beforehand either a change to the table structure or something new in the front end has caused the problem.

Have you compacted and repaired both FE and BE?
 

zebrafoot

Member
Local time
Today, 10:16
Joined
May 15, 2020
Messages
48
Hi Minty,

What I mean is that versions in April/early May were working, without showing any error. The errors first appeared while I was making changes to a stable version. When I ran out of ideas on how to sort the issues out I went back to a previous version and that gave an error....and another version, which also gave an error, and another..... What's baffling is that I've never seen any of these error descriptions previously and even if I wasn't soak-testing very thoroughly, I'm sure I would have seen them owing to how central the forms are to the database as a whole.

I also notice that very infrequently I also see an error "no current record" when switching to Design View - again, something I have never observed previously.

Pete
 

zebrafoot

Member
Local time
Today, 10:16
Joined
May 15, 2020
Messages
48
I've copied the back end from our remote server to my computer and I'm still getting the same issue when I link to those files.
Perhaps it's time to make copies and post with just enough data to show the issue. We don't need all your data - only enough (even mock data) to highlight the issue.

If the issue still occurs when you put FE and BE on your local PC, I can't see how connectivity is the issue.
Hi jdraw,

Thanks for taking the time to answer. I can't with real data as it's confidential. If I can put together a smaller version of the db with mock data, I will.

Pete
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:16
Joined
Feb 28, 2001
Messages
22,514
If you reverted to an older version and it still gives errors, even when FE and BE are BOTH local, you need to look to the update history of the machines in question.

However, in the case of the older FE also failing, my question is whether you made a structural change to the BE such that you are now running older FE code against an updated BE?
 

zebrafoot

Member
Local time
Today, 10:16
Joined
May 15, 2020
Messages
48
If you reverted to an older version and it still gives errors, even when FE and BE are BOTH local, you need to look to the update history of the machines in question.

However, in the case of the older FE also failing, my question is whether you made a structural change to the BE such that you are now running older FE code against an updated BE?

I've just opened a version of the FE from 16-02-2022. I deleted all the linked tables and re-linked them using the tables that I saved on the same day. Both files are local. I'm getting the error again, exactly as I did initially with the newest version. Going into design view also causes the error "no current record".

I've tried the same thing with multiple old versions of FE and BE and I'm getting the same behaviour over and over again.

I have looked at the update history of my laptop and there's nothing that seems to have occurred between the last time everything worked ok and this morning, except for a printer that I installed. I've removed that and removed the printer driver, but no dice.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:16
Joined
Feb 28, 2001
Messages
22,514
Does this error occur when opening the form or is it related to a code-based activity? (Looking for a specific line of code to be highlighted.) The problem with making rabbit stew is catching the rabbit; the rest is usually trivial.

By any chance do you have warnings turned off in your context? That might make it harder to detect the actual location of an error.
 

zebrafoot

Member
Local time
Today, 10:16
Joined
May 15, 2020
Messages
48
I have a form with a subform in it. The overarching form is for a customer "opportunity", the subform lists the quotes we've made to date. Clicking a button on the subform adjacent to a quote takes me to a detailed overview of that quote. The error flashes up, but the data appear to load correctly in spite of the warning.

The button triggers the following code:

DoCmd.OpenForm "frmQuoteOverview", acNormal, , "[QuoteID]=" & Me![QuoteID]
DoCmd.Close acForm, "frmQuotes", acSavePrompt

The form "frmQuoteOverview" then opens, with a bit of VBA to determine exactly what components are visible to the user depending on the exact nature of the quote. I've stepped through with the debugger on and I can't see what's causing the problem. Once the from frmQuoteOverview is loaded, hitting "Refresh All" doesn't trigger any error, so it's not something to do with the data. Likewise, opening the form frmQuoteOverview happens without incident.

I appreciate your effort helping me with this.
 

zebrafoot

Member
Local time
Today, 10:16
Joined
May 15, 2020
Messages
48
Sorry, to clarify my earlier reply, opening the form DIRECTLY from the panel on the left hand side works without error.
 

Minty

AWF VIP
Local time
Today, 10:16
Joined
Jul 26, 2013
Messages
9,237
That infers that for some reason this bit of your code to open the form isn't correct.
"[QuoteID]=" & Me![QuoteID]

What if you hard code a number in there or better still do this

Code:
Dim lQuote as Long
lQuote = Me.[QuoteID]

debug.print lQuote
DoCmd.OpenForm "frmQuoteOverview", acNormal, , "[QuoteID]=" & lQuote
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:16
Joined
Feb 28, 2001
Messages
22,514
OK, the last two posts (15 & 16) help, because it seems that when you open the form directly with no WHERE condition, it works, but when you try to open it with a filter, it fails. That means you need to look at the WHERE clause to see what is wrong with it.

EDIT: Minty and I got here at the same time, apparently.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:16
Joined
Feb 28, 2001
Messages
22,514
A second thought just popped up in my mind.

You are opening one form and closing another with a SAVE option in two lines of code. Is it perhaps that the "No current record" is for the frmQuotes that you are closing after you open the frmQuoteOverview? I.e. the error isn't for the opening form, it is for the closing form.
 

zebrafoot

Member
Local time
Today, 10:16
Joined
May 15, 2020
Messages
48
Thank you both for your continued patience.

Access is behaving quite strangely for me as I think I have demonstrated - now it's changing between "property not found" and "no current record" and I'm not seeing a pattern of why. Taking the example that Minty gave, if I force the form to open to a specific record:

DoCmd.OpenForm "frmOpportunity", , , "[OpportunityID]= 895"
DoCmd.Close acForm, "frmQuotes"

(Note the above is doing the open in the opposite direction, i.e. going back to the overview, rather than opening the detailed form and that I've removed any save command).
I still get an error ("search key....", "current record...." or "property..."), but it does open at the correct record. Refreshing the form throws no error.

Note to Minty: I do normally do something similar:

Dim intQuote as integer
intQuote = me.QuoteID
etc
 

Users who are viewing this thread

Top Bottom