Form CloseButton property not working

J

Jeff

Hello,

When I try using the below Code in anywhere in the Form
Code

Me.CloseButton = False

I get an error 2448, you cant assign a value to this
object.

But according to Access Help & Microsofts website it says
I can, it says I can write to it.

Why am I getting this error, can this property be changed
through code ?

I know there are other ways to trap using Cancel in the
Unload event but I want the above, can this be done ?

Thank you,
Jeff
 
G

Graham Mandeno

Hi Jeff

What sort of control is CloseButton. If, as it sounds, it is a command
button, then you certainly cannot assign a value to it.

What do you want to achieve? You can make it invisible:
Me.CloseButton.Visible = False

.... or diabled (greyed out)
Me.CloseButton.Enabled = False
 
G

Guest

Graham,

Boy are u way OFF, how are u an Access MVP ???

It says right in the Subject line "FORM Property"

Does anyone else have an answer ?



-----Original Message-----
Hi Jeff

What sort of control is CloseButton. If, as it sounds, it is a command
button, then you certainly cannot assign a value to it.

What do you want to achieve? You can make it invisible:
Me.CloseButton.Visible = False

.... or diabled (greyed out)
Me.CloseButton.Enabled = False

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Jeff said:
Hello,

When I try using the below Code in anywhere in the Form
Code

Me.CloseButton = False

I get an error 2448, you cant assign a value to this
object.

But according to Access Help & Microsofts website it says
I can, it says I can write to it.

Why am I getting this error, can this property be changed
through code ?

I know there are other ways to trap using Cancel in the
Unload event but I want the above, can this be done ?

Thank you,
Jeff


.
 
G

Graham Mandeno

Well, I must admit that I didn't read your subject line carefully enough,
and I apologise for that.

But rather than being abusive to people who are trying to help, I suggest
you *read* the help you say you have looked at, and there you will find it
states quite clearly:
You can set the CloseButton property only in form Design view.

--
Graham Mandeno [Access MVP]
Auckland, New Zealand


Graham,

Boy are u way OFF, how are u an Access MVP ???

It says right in the Subject line "FORM Property"

Does anyone else have an answer ?



-----Original Message-----
Hi Jeff

What sort of control is CloseButton. If, as it sounds, it is a command
button, then you certainly cannot assign a value to it.

What do you want to achieve? You can make it invisible:
Me.CloseButton.Visible = False

.... or diabled (greyed out)
Me.CloseButton.Enabled = False

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Jeff said:
Hello,

When I try using the below Code in anywhere in the Form
Code

Me.CloseButton = False

I get an error 2448, you cant assign a value to this
object.

But according to Access Help & Microsofts website it says
I can, it says I can write to it.

Why am I getting this error, can this property be changed
through code ?

I know there are other ways to trap using Cancel in the
Unload event but I want the above, can this be done ?

Thank you,
Jeff


.
 
G

Guest

It clearly states

"You can set the CloseButton property by using the form's
property sheet, a macro, or Visual Basic."

So how can you do it throug VB ?

-----Original Message-----
Well, I must admit that I didn't read your subject line carefully enough,
and I apologise for that.

But rather than being abusive to people who are trying to help, I suggest
you *read* the help you say you have looked at, and there you will find it
states quite clearly:
You can set the CloseButton property only in form Design view.

--
Graham Mandeno [Access MVP]
Auckland, New Zealand


Graham,

Boy are u way OFF, how are u an Access MVP ???

It says right in the Subject line "FORM Property"

Does anyone else have an answer ?



-----Original Message-----
Hi Jeff

What sort of control is CloseButton. If, as it
sounds,
it is a command
button, then you certainly cannot assign a value to it.

What do you want to achieve? You can make it invisible:
Me.CloseButton.Visible = False

.... or diabled (greyed out)
Me.CloseButton.Enabled = False

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Hello,

When I try using the below Code in anywhere in the Form
Code

Me.CloseButton = False

I get an error 2448, you cant assign a value to this
object.

But according to Access Help & Microsofts website it says
I can, it says I can write to it.

Why am I getting this error, can this property be changed
through code ?

I know there are other ways to trap using Cancel in the
Unload event but I want the above, can this be done ?

Thank you,
Jeff


.


.
 
G

Graham Mandeno

You open the form in design view - probably not a viable option for what you
want to achieve, sorry.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

It clearly states

"You can set the CloseButton property by using the form's
property sheet, a macro, or Visual Basic."

So how can you do it throug VB ?

-----Original Message-----
Well, I must admit that I didn't read your subject line carefully enough,
and I apologise for that.

But rather than being abusive to people who are trying to help, I suggest
you *read* the help you say you have looked at, and there you will find it
states quite clearly:
You can set the CloseButton property only in form Design view.

--
Graham Mandeno [Access MVP]
Auckland, New Zealand


Graham,

Boy are u way OFF, how are u an Access MVP ???

It says right in the Subject line "FORM Property"

Does anyone else have an answer ?




-----Original Message-----
Hi Jeff

What sort of control is CloseButton. If, as it sounds,
it is a command
button, then you certainly cannot assign a value to it.

What do you want to achieve? You can make it invisible:
Me.CloseButton.Visible = False

.... or diabled (greyed out)
Me.CloseButton.Enabled = False

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Hello,

When I try using the below Code in anywhere in the Form
Code

Me.CloseButton = False

I get an error 2448, you cant assign a value to this
object.

But according to Access Help & Microsofts website it
says
I can, it says I can write to it.

Why am I getting this error, can this property be
changed
through code ?

I know there are other ways to trap using Cancel in the
Unload event but I want the above, can this be done ?

Thank you,
Jeff


.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top