Compile Error Now Present in Access 2016 db (1 Viewer)

Smokeeater

Registered User.
Local time
Today, 12:06
Joined
Jan 15, 2009
Messages
58
Previously had Access 2010, now on 2016. I have a database that has several fields that start with "5S3D....", not only in the tables but on 2 forms, several queries, and reports. All of sudden everything came to a screeching halt, all pointing towards these fields.

Coding is used to unhide fields based on whether another field on the input form is null or not, and all worked fine until my 2016 upgrade. Now I am getting errors all pointing towards these fields. If I try to compile the code in the VBA window, and I get a "Compile Error: Expected: =" message. Pressing the help button provides no direct reason why the field information now does not work. Here is how the code now looks.

Me!5S3D_Proper_Layout2.Visible = True

Just for the fun of it I removed the Me! on one line of code, and it will automatically put a space between the "5" and the "S", which cannot be removed.

I prefer to not have to change the names of the fields (28 in all) in the tables, queries, reports, and all of the different locations in code, if at all possible.

Thanks.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:06
Joined
May 7, 2009
Messages
19,248
Enclosed the name in sqr bracket
 

isladogs

MVP / VIP
Local time
Today, 17:06
Joined
Jan 14, 2017
Messages
18,241
Each version of Access is less tolerant of potential issues than previous versions

Arnel's suggestion should work but in general its not a good idea to have field names or control names starting with a number due to issues like this
 

Minty

AWF VIP
Local time
Today, 17:06
Joined
Jul 26, 2013
Messages
10,371
To back up what Ridders says, this is probably caused by 2016 using SQL based background processing.
In SQL server you cannot have a field name starting with a number. So if you ever up-scaled to SQL Server backend you would have to change the field names anyway.
 

Smokeeater

Registered User.
Local time
Today, 12:06
Joined
Jan 15, 2009
Messages
58
arnelgp, ridders, & Minty,

Thank you each for your replies. I sort of knew what I thought would be the best course of action, and that is to restructure the names, so that is what I will do.

Like you mentioned ridders, each version is less tolerable to mistakes or poor coding used in previous versions. I have been working with Access since it's conception, and while most of the updates in each generation are usually good, there is noticeable growing pains as well.

Thanks again everyone.
 

Users who are viewing this thread

Top Bottom