0
votes

I have an Access Front-End in which I want to auto-detect whether it is compiled into an accde, and then rename the apptitle.

If CurrentDb.Name Like "*.accde" Then
    CurrentDb.Properties("AppTitle").value = "Release Client"
    Application.RefreshTitleBar
Else
    CurrentDb.Properties("AppTitle").value = "Test Client"
    Application.RefreshTitleBar
End If

When I launch my .accdb in which I develop/test, everything works. I can change the apptitle manually, close and reopen, and it renames to Test Client. However, once I compile it, upon launching the newly compiled .accde, it does not rename the apptitle.

I tried moving the code from the AutoExec function to the first form's OnOpen event and even to the first form's OnTimer event (with a setting of 1).

If I run the code manually through the Immediate window, it resolves appropriately, so the code seems correct.

I think I'm missing the link between running this code in an .accdb and running it in an .accde.

1
I tested your code in Access 2010 from the form load event of my startup form. It displayed Release Client as the app title of my ACCDE, and Test Client for the ACCDB. I don't understand why it's not working for you. :-( - HansUp
Must you set app title again every time the database is opened? Set it to Test Client in the ACCDB. After you create the ACCDE, change it's app title to Release Client. And after that would you ever need to change the ACCDE's app title again? - HansUp
Oh, I certainly don't have to, but I was hoping I could so I never have to remember to keep renaming. :) As for the test, I'm currently working in Access 2016, so maybe that's the difference? - Asher Litwin
Well, I just realized I'm a fool. I was saving it out to one location, but had forgotten that I was using another location for my launcher to point to! Once I updated the proper location, it all worked properly. - Asher Litwin

1 Answers

2
votes

Turns out I was in the wrong, with the most basic of foolishness. I have a launcher which I was pointing to one location, but had forgotten to update my compilation to that new location. :) Which means my original code works great, as HansUp mentioned, in the Form Load.