Autocenter does not work in Access 2003

i am trying to autocenter in the screen my forms in Access 2003. I tried setting the property to yes, I tried VBA code Me.Autocenter=True and it gives me an error "Run-time error 2448 You can't assign a value to this object"
dailymeatAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gustav BrockCIOCommented:
It will autocenter relative to the Access window, not the screen - if that is what you expect.
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
From the Help article:

You can set this property only in Design view.

https://msdn.microsoft.com/en-us/library/office/ff821162(v=office.14).aspx

If you need to center the form at runtime, use something like this:

http://www.peterssoftware.com/ci.htm

Or you can set the Top and Left properties of your form.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dailymeatAuthor Commented:
Thank you.

Gustav , the form does not center when I set the property to yes in the Access window, and if I use VBA code Me.Autocenter=True it gives me an error "Run-time error 2448 You can't assign a value to this object"

Scott,  this I tried https://msdn.microsoft.com/en-us/library/office/ff821162(v=office.14).aspx and that's how I get "Run-time error 2448 You can't assign a value to this object"

I tried http://www.peterssoftware.com/ci.htm before and it does not work right in the subforms.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Gustav BrockCIOCommented:
If it is a specific form, then recreate it from scratch bit by bit and notice which setting will disable then Autocenter property.
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Scott,  this I tried https://msdn.microsoft.com/en-us/library/office/ff821162(v=office.14).aspx and that's how I get "Run-time error 2448 You can't assign a value to this object"
Do you mean when setting this IN DESIGN VIEW that you get that error? If so, then heed Gustav's advice about recreating your form. You might also consider performing maintenance on the database as well (i.e. compact, compile, etc).
dailymeatAuthor Commented:
Thank you.

Gustav, Is not a specific form I have around 50.

Scott, I get the message when I tried to open it in form view. The .mdb is set to compact on close, I do compiling often.
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Did you read my comment here:

From the Help article:

   
You can set this property only in Design view.


https://msdn.microsoft.com/en-us/library/office/ff821162(v=office.14).aspx

This means you CANNOT do this at runtime. You must open the form in Design view, set the AutoCenter property in the Properties dialog, and then close and save the form.

Side Note: Compact on Close is generally not necessary in a properly deployed database. You should always use a "split" architecture, where you have a Backend (Tables only) and a FrontEnd (everything else). If you do, then compact on close will only affect the FE, which is not the one you worry about.
dailymeatAuthor Commented:
Still does not center the form
Gustav BrockCIOCommented:
What does "still" mean? Did you set the property in Design View?

Scott is right. Any attempt to set the property in other view will raise an error.
dailymeatAuthor Commented:
I think I am confused, what I want to achieve is when I open a form that the form is centered in the window, NOT on the top left hand side of the window. So by writing VBA code on the "open" event in design view Me!autocenter=True, I thought that when I open the form in form view it would be centered in the window no matter the size of the window.
Gustav BrockCIOCommented:
I don' think you are confused, it just appears not to be possible that way.

The method I have used, is to use the Move method of the form after having opened it. Trouble is, that you first have to find out how many units to move it.
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
You can't use code to do this, as we've mentioned several times. You MUST use the Properties dialog to do this with the Form in Design View:

Autocenter
dailymeatAuthor Commented:
I have set that property to yes and nothing happens
dailymeatAuthor Commented:
Gustav, Scott

I found out why the auto center property was not working, I had a command to Maximize the form, thank you for your help.

How do I  divide the points 50/50?
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Glad you got things sorted.

Here's a link to a Help page that may help you close out your question: http://support.experts-exchange.com/customer/portal/articles/608596
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.