Remove Expr1: (1 Viewer)

gblack

Registered User.
Local time
Today, 03:41
Joined
Sep 18, 2002
Messages
632
There is likey a better way to do this... maybe some functionality in Access where you just press a button... that I just didn't know about.

If you've ever accidentally moved or changed an underlying table to a query and then opened your query... Then realized what you just did, closed the query without saving it then put the table back... only to find when you opened the query again, Access has nicely added all sorts of new aliases for you starting with Expr1:, Expr2... Expr100...

Anyway, I got tired of going in the the SQL and deleting everywhere it said "as Expr#". You can't just replace Expr with nothing in notepad since theres always a numbered suffix 1, 2, 3... 144 etc... Or maybe you can and I don't know the method... If there's a simple way of doing this in notepad please let me know.

Short of that... I made a little tool where you can just cut and paste your SQL statement into the Form's window, press a button and it automatically removes any Expr AND the corresponding number.

It can also save the newly removed Expr code to your clipboard, if you want, so you can just paste it right back cleanly to wherever you got it from... I think I got that clipboard code from this site... but I am not sure. I take no credit for that, I don't even really understand it honestly... it just works...hahaha.

In fact I only take credit for being annoyed enough with long queries getting messed up by the Expr# aliases, to put something together to rid myself of tedious deletes.

There's nothing to the accdb file really... Just a couple objects and a Form you can post your SQL to. I found it helps me now and again, so I figured I'd post it to the site... in case anyone else ever has the same issues.

HTHs,
-Gary
 

Attachments

  • RemoveExpr1.accdb
    392 KB · Views: 97

Users who are viewing this thread

Top Bottom