Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CloseButton property

Status
Not open for further replies.

StuMunro

Programmer
Mar 2, 2001
29
GB
I am trying to enable/disable the close button (x) on a form from vba. When I do

me.CloseButton = true

I get the following error.

runtime error 2448

You can't assign a value to this object.
* The object may be a control on a read-only form.
* The object may be on a form that is open in Design view.
* The value may be too large for this field.

The help states you can set this property from vba.

I have checked the form is not read only ie allowadditions, allowedits etc.

Can anyone help?

Stu.
 
Stu:
I'm assuming that "CloseButton" is the name of your button. One other point not to forget is that the focus cannot be on "CloseButton" when you try to disable it. So add a line in before like:
Me.NameOfAnotherControl.Setfocus
Should go!
Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top