473,320 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

A2K - changing control property at runtime - is this possible?

Hi,

I need to disable a command button at some point. Easy enough. Initially
in design view it is set as enabled.

Now once I disable it, how can I ensure that when the app is restarted, the
Enabled property in design view is now set to disabled (i.e Enabled = No).

I don't want to track this using a flag in a table if at all possible and
the final app is an MDE. I suspect this can't be done but any comments
would be welcome.

thanks
Martin
Nov 12 '05 #1
1 2190
Bob Quintal <bq******@generation.net> wrote in
news:50******************************@news.teranew s.com:
"Deano" <ma************@hotmail.com> wrote in
news:rC*******************@wards.force9.net:
Hi,

I need to disable a command button at some point. Easy
enough. Initially in design view it is set as enabled.

Now once I disable it, how can I ensure that when the app is
restarted, the Enabled property in design view is now set to
disabled (i.e Enabled = No).

I don't want to track this using a flag in a table if at all
possible and the final app is an MDE. I suspect this can't
be done but any comments would be welcome.

Interesting issue. I believe that the doCmd.Deleteobject works
in an .mde. How about setting the control disabled in design
view and putting some code executed from the autoexec macro or
welcome form that enables it. The code would test the
existence of some object in the database, such as a query.
Once the query is deleted, the control no longer can be
enabled.

Bob Q


I got creative. I created a macro that sets the command button
enabled = true. Called the macro from the form.open event inside an
error handler that traps the "Object does not exist error".

Added a button that calls the .deleteobject on that macro. I made
that invisible.

Modified the macro to set the new button visible.

Made mde. Tested.

After clicking on the delete button, closing and reopening the
form, the first button was disabled and the second was hidden.
Bob Q

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Weinand Daniel | last post by:
i'd like to monitor changes of the "Control.Name" porperty during designtime. if the user changes the name in designer my event musst fire. i have created a own button control. with an event...
1
by: Jeff N | last post by:
It it possible to change a button's or text box's font size during runtime? When I try to build my application with this code: this.ActiveControl.Font.Size = "8.25"; I get this error message:...
1
by: Pradeep | last post by:
Hi, Is it possible to conditionally change the value of the "Browsable" attribute at the top of the property constructor at runtime in VC++.net? For example, I would like to conditionally change...
0
by: Jeff Schaefer | last post by:
What I want to know is this: Is it possible to programmatically manipulate a custom property of a user control for which <%@ OutputCache ... > has been included? If so, then how? My brief code is...
5
by: Carlo Marchesoni | last post by:
Is it possible to change the document's title property from code behind (c#) ? I need to build a dynamic title at runtime.
7
by: Smithers | last post by:
I have a non trivial ASP.NET Web application that implements its navigation system via a user control (menu.ascx) placed on every page. It is important to note that the user control that hosts...
3
by: CsaaGuy | last post by:
Hi, i created a class that i have showing up at design time and i have to save some of the properties to the viewstate at runtime. It all works fine, however the issue is if i have more that one...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
3
by: Joseph Gruber | last post by:
Hi all -- I have two questions. First, I'm adding a control to my form at runtime and the control/form seems to ignore the anchor property of the runtime control. Any idea how I can get a...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.