PC Review


Reply
Thread Tools Rate Thread

set .ContolBox and .CloseButton to yes

 
 
Angi
Guest
Posts: n/a
 
      14th Feb 2005
I know there's not a way to change the default view of a form
programatically, but is there a way to change the CloseButton and
ControlBox properties? They are currently No.

Here's what I have:
DoCmd.OpenForm "frmcustomersearch"
With Forms!frmcustomersearch
.CmdSwitch.Visible = False
.ControlBox = True
.CloseButton = True
End With

The CmdSwitch works, but the others don't. Just wondering if I'm doing
it wrong or it's just not possible.

TIA!

 
Reply With Quote
 
 
 
 
Graham Mandeno
Guest
Posts: n/a
 
      14th Feb 2005
Hi Angi

Sorry, these two properties can be set only in design view.

A workaround would be to disable them permanently, and provide your own
Close button which you can show or hide as required.

Another would be to intercept the close operation in the Unload event and
cancel it if you don't want the user to use the close button at that time.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

"Angi" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I know there's not a way to change the default view of a form
> programatically, but is there a way to change the CloseButton and
> ControlBox properties? They are currently No.
>
> Here's what I have:
> DoCmd.OpenForm "frmcustomersearch"
> With Forms!frmcustomersearch
> .CmdSwitch.Visible = False
> .ControlBox = True
> .CloseButton = True
> End With
>
> The CmdSwitch works, but the others don't. Just wondering if I'm doing
> it wrong or it's just not possible.
>
> TIA!
>



 
Reply With Quote
 
 
 
 
Rob Oldfield
Guest
Posts: n/a
 
      14th Feb 2005
You can only change them in design view. So it would be something like...

DoCmd.OpenForm "frmcustomersearch", acDesign, , , , acHidden
With Forms!frmcustomersearch
.ControlBox = true
.CloseButton = true
End With
DoCmd.OpenForm "frmcustomersearch"

....the hidden parameter is there to minimise the amount of screen flicker
caused by opening the form in design view.


"Angi" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I know there's not a way to change the default view of a form
> programatically, but is there a way to change the CloseButton and
> ControlBox properties? They are currently No.
>
> Here's what I have:
> DoCmd.OpenForm "frmcustomersearch"
> With Forms!frmcustomersearch
> .CmdSwitch.Visible = False
> .ControlBox = True
> .CloseButton = True
> End With
>
> The CmdSwitch works, but the others don't. Just wondering if I'm doing
> it wrong or it's just not possible.
>
> TIA!
>



 
Reply With Quote
 
Angi
Guest
Posts: n/a
 
      14th Feb 2005
OK...so let me get this straight. I can use the button on the form
(already had that) or...

Open the form, change the design, close the form, open the form to
view, close the form, open the form, change the design back to No then
close the form again?

Won't that take a while? If so, I think I'll go with a button. Seems
like a lot of code for a little X!

Thanks guys

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Yes/No fields and code to uncheck a default "yes" box if another yes box is checked Repent Microsoft Access Forms 5 17th Jul 2009 05:18 AM
1=Yes 0=No in Validation rule. 1=Yes become -1=Yes MMC Microsoft Access 1 23rd Apr 2008 09:08 PM
Set Yes/No field to Yes based on criteria in other fields =?Utf-8?B?SXRzQmFyYmFyYQ==?= Microsoft Access Getting Started 2 23rd Mar 2006 06:37 PM
1 column with YES and NO responses. Can we sum for ea. total of YES's and NO's? (Okay to put results into 2 separate cells). StargateFanFromWork Microsoft Excel Programming 6 8th Dec 2005 10:20 PM
Yes,Yes,Yes,Yes,Yes,Yes! in a query paul.hoyle Microsoft Access Queries 1 23rd Jan 2005 06:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:32 PM.