The Microsoft Access database engine does not recognize ‘rep……’ as a valid field name or expression (1 Viewer)

SachAccess

Active member
Local time
Today, 14:42
Joined
Nov 22, 2021
Messages
389
Hi,
I am trying to double click on a Report in MS Access DB file.
When I double click I get a pop-up saying ‘The Microsoft Access database engine does not recognize ‘rep……’ as a valid field name or expression’.
What does this mean. Can anyone please help me in this.
 

SachAccess

Active member
Local time
Today, 14:42
Joined
Nov 22, 2021
Messages
389
what is the code in your double click event?
Thanks for the help. Am sorry, I do not know how to check the code related to the report.
I have added break-point to all the modules from the DB and trying to click one report, form at a time to check what code is assigned to which object.
When am trying to double click on this report am getting this pop-up.
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:12
Joined
Sep 21, 2011
Messages
14,319
Put a breakpoint in the report open event and F8 from there.
If you have no code in the open even, put a msgbox there as a temporary measure.
 

SachAccess

Active member
Local time
Today, 14:42
Joined
Nov 22, 2021
Messages
389
Hi @gemma-the-husky , when I open VBA code editor, I can see that particular report name. However when I double click on the Report, can not see macro going to that particular sub.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:12
Joined
Sep 12, 2006
Messages
15,658
I am not familiar with new super macros to be honest.

If you design the report, find your way to properties, (select the small top left square of the entire reports in design mode, right click, and select properties). Then find the events tab at the top. That's the report properties. Find the double click event, and that should have an entry - you should be able to press the ellipsis (...) on the right, and navigate to whatever the double-click does. That's what you/we need to see.

I just looked and I can't see a double click event for a report - so you must be clicking something else. Can you show a screenshot of what you are actually clicking?
 
Last edited:

SachAccess

Active member
Local time
Today, 14:42
Joined
Nov 22, 2021
Messages
389
Hi Experts.
When I click Open on the Report it gives me a pop-up. However if I right-click on the Report select Layout View it still gives me the pop-up but takes to code there after and opens the Report once the code is executed. Not able to understand the reason.
 

SachAccess

Active member
Local time
Today, 14:42
Joined
Nov 22, 2021
Messages
389
I am not familiar with new super macros to be honest.

If you design the report, look for events, and then find double-click - you should be able to press the ellipssis (...) on the right, and navigate to whatever the double-click does. That's what you/we need to see.
My bad, I did not mean Macro, I meant VBA code.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:12
Joined
Sep 12, 2006
Messages
15,658
Well a screen shot would help. I can't see a double click event for the report as a whole, so it's not clear exactly what you ARE clicking.
 

SachAccess

Active member
Local time
Today, 14:42
Joined
Nov 22, 2021
Messages
389
Well a screen shot would help. I can't see a double click event for the report as a whole, so it's not clear exactly what you ARE clicking.
Thanks for the help! Am not allowed to post screenshot. Apologies. I will try if I can re-create same on my personal machine and post here for easier reference. Have a nice day ahead. :)
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:12
Joined
Feb 28, 2001
Messages
27,194
Does the literal message contain rep...... (i.e. lower case "rep" followed by six dots)? If so, you should be able to do a project-wide search for that string. Heck, you should be able to find rep. (rep plus one dot) just to get started in tracing it down. Access rarely abbreviates something to three characters followed by a double ellipsis. It tends to be literal-minded about names.
 

SachAccess

Active member
Local time
Today, 14:42
Joined
Nov 22, 2021
Messages
389
Does the literal message contain rep...... (i.e. lower case "rep" followed by six dots)? If so, you should be able to do a project-wide search for that string. Heck, you should be able to find rep. (rep plus one dot) just to get started in tracing it down. Access rarely abbreviates something to three characters followed by a double ellipsis. It tends to be literal-minded about names.
Hi,
Thanks for the help.
The message is something like 'The Microsoft Access database engine does not recognize rep_00A_AbcdResults.Dummy' as a valid field name or expression.
00A, Abcd and Dummy are fake values. Actual values on my DB are different.
PS - I am not allowed to post real names hence trying to edit. Forgot to mention in my original post.
Will take care going forward.
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:12
Joined
Sep 21, 2011
Messages
14,319
Hi,
Thanks for the help.
The message is something like 'The Microsoft Access database engine does not recognize rep_00A_AbcdResults.Dummy' as a valid field name or expression.
00A, Abcd and Dummy are fake values. Actual values on my DB are different.
PS - I am not allowed to post real names hence trying to edit. Forgot to mention in my original post.
Will take care going forward.
Well that explains it. :(
How do you expect Access to work with names it knows absolutely nothing about? :mad:
 

SachAccess

Active member
Local time
Today, 14:42
Joined
Nov 22, 2021
Messages
389
Well that explains it. :(
How do you expect Access to work with names it knows absolutely nothing about? :mad:
Hi,
Sorry for making it confusing for everyone.
'The Microsoft Access database engine does not recognize rep_00A_AbcdResults.Dummy' as a valid field name or expression.'
This is the pop-up am getting. I have changed some of the text from the original pop-up while posting here.
I have not changed anything in the DB.
In my original post, instead of posting the entire pop-up I pasted only partial version of the pop-up.
That was certainly my mistake. Will take utmost care going forward with the details so that experts time is not wasted.
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:12
Joined
Sep 21, 2011
Messages
14,319
I have a member in another forum, who I advised to use theDBguy's generic recordset for a query source as recordset with parameters.
He just copied the code I advised to use in place of his recordset code and then came back and said it said 'Unknown function'

Never occured to him that he needed to copy the actual code into his DB to be able to use it? :)
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:12
Joined
Sep 12, 2006
Messages
15,658
Hi,
Sorry for making it confusing for everyone.
'The Microsoft Access database engine does not recognize rep_00A_AbcdResults.Dummy' as a valid field name or expression.'
This is the pop-up am getting. I have changed some of the text from the original pop-up while posting here.
I have not changed anything in the DB.
In my original post, instead of posting the entire pop-up I pasted only partial version of the pop-up.
That was certainly my mistake. Will take utmost care going forward with the details so that experts time is not wasted.
I appreciate it's difficult for you, but a snippet of code really should possible to post without breaking confidentiality requirements. It's next to impossible to diagnose the problem, when we can't see the code, and we aren't really sure what you are actually clicking. Maybe you need to pay for a consultant to advise you - maybe share a Teams session with you, and view the issue first hand.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:12
Joined
Feb 28, 2001
Messages
27,194
OK, two things pop out at me:

First, that is a specific message from the ACE engine. It is a statement that the engine attempted something and failed to find whatever the name really was. That means that SQL is involved. It is not VBA trying to find something. It is SQL trying to find something. There are a few ways that can happen. I'll get to that in a moment. Further, if there really IS a dot in that name, it would seem to me that the first part of the name is the query name and the second part is the field name. As a sanity check, if that dot really is there, does the name to the left match the name of the report? If so, then the name to the right is all you need to find. If not, you might have found the problem right away.

Second, this happens when you try to launch a report. A single- or double-click on a report item doesn't make a difference if there is no code for the double-click. Access just converts that to a single click and carries on with whatever it needs to do next, so the absence of double-click code is no biggie. The execution of single-click code is also no surprise.

Even if the report was originally built based on a stored query, there might be some differences between the original query and what the report sends to ACE. Reports analyze the query so that they can impose their own ideas on the data, particularly if the report has grouping and sorting built-in. If the report's designer manually imposed sort or group options, that would be enough for Access to create an alternative query as the source of the data set. These would qualify as "hidden" queries so you might have to show hidden queries when trying to find the culprit. The name of the "alternative" query would have a tilde (~) as its first character and would resemble the name of the report.

The ways that SQL gets involved here would be either the actual SQL of the report's .Recordsource or as a quoted string in one of the arguments of a domain aggregate like DLookup" or "DSum" or "DCount" in a page header, report header, group header, or detail section on the first page. The criterion for a domain aggregate doesn't get checked until you actually open the aggregate function. Or you could have opened a separate recordset based on a quoted SQL string for some reason behind the scenes of the report. You should be able to search the report's VBA code for the string in question. Since it is related to the report, that really narrows where to look. If you can't find it in the VBA code, it isn't likely to be in any other function.

If the code search draws no result, then look at the form in design view and look at its .RecordSource - and if there is a sub-report as part of the design, it would be possible for there to be an error in the field name of the parent/child linking fields. The biggest chance is the main report's .Recordsouce. I would say that there is a chance that an automatically generated report would make the reference, except that if it was automated, the automation wouldn't select an invalid field. So this is PROBABLY the result of someone "adjusting" some element of the report's design or query.
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:12
Joined
Sep 21, 2011
Messages
14,319
O/P has already stated they are using 'dummy' fields that do not exist?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 04:12
Joined
Feb 28, 2001
Messages
27,194
O/P has already stated they are using 'dummy' fields that do not exist?
For his examples because he feels he cannot reveal actual names. Whether I agree with the strictness over revealing names, there is still the issue that I have to honor his statement until he feels comfortable.
 

Users who are viewing this thread

Top Bottom