473,667 Members | 2,589 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Saving Form Properties when closing & reopening a form

6 New Member
I am trying to set the "backcolor" property in fields in a form. It sets okay using a macro (setvalue). But when I close the form, the property settings revert back to what they were before I closed the form. So when I reopen the form, the settings are not changed. If I manually change the settings while not in Design mode (using the "fill with" icon), the settings hold. If I change the settings while in Design mode, the settings do not hold.
My goal is to have a form that indicates the status of individual "units" determined by the backcolor of each field that refers to a unit. I want to have a macro that will automatically set the backcolor of the field when the status of the unit changes.

Thanks in advance for your expert opinion.

Bill Stillwell
Nov 21 '06 #1
2 2214
LenaWood
8 New Member
I am trying to set the "backcolor" property in fields in a form. It sets okay using a macro (setvalue). But when I close the form, the property settings revert back to what they were before I closed the form. So when I reopen the form, the settings are not changed. If I manually change the settings while not in Design mode (using the "fill with" icon), the settings hold. If I change the settings while in Design mode, the settings do not hold.
My goal is to have a form that indicates the status of individual "units" determined by the backcolor of each field that refers to a unit. I want to have a macro that will automatically set the backcolor of the field when the status of the unit changes.

Thanks in advance for your expert opinion.

Bill Stillwell
Sounds like you are wanting conditional formatting. I am not sure how you would go about doing it with a Macro, but you could use the On Current Event of the form and do something like

If [FieldName] = "Occupied" Then
FieldName.BackC olor = VBRed
AnotherField.Ba ckColor = VBRed
Else
FieldName.BackC olor = VBYellow
AnotherField.Ba ckColor = VBYellow
End If
Nov 21 '06 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
As Lena said it sounds like you want conditional formatting. Check it out by:

In design view click on the textbox (field control) and go to the Menu Format and choose Conditional Formatting.

The wizard will open to let you set the backcolour based on field values.

Mary


I am trying to set the "backcolor" property in fields in a form. It sets okay using a macro (setvalue). But when I close the form, the property settings revert back to what they were before I closed the form. So when I reopen the form, the settings are not changed. If I manually change the settings while not in Design mode (using the "fill with" icon), the settings hold. If I change the settings while in Design mode, the settings do not hold.
My goal is to have a form that indicates the status of individual "units" determined by the backcolor of each field that refers to a unit. I want to have a macro that will automatically set the backcolor of the field when the status of the unit changes.

Thanks in advance for your expert opinion.

Bill Stillwell
Nov 21 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
8572
by: CSDunn | last post by:
Hello, I have an Access 2000 Project in which the data comes from a SQL Server 2000 database, and multiple users need to be able to see new records as each user adds records. The users also need to be aware of updates as they are made to current records. The data the users are looking at is presented in a subform that has the Default View property set to 'Single Form'. In order for each user to see the update to the current record as...
1
1444
by: Andrew | last post by:
In Access 2000, I have a form for Horse and a subform for Stable which contains a combo box showing empty stables. If I enter a StableNo and a DateIn (but no DateOut), the underlying query correctly shows that stable as being unavailable. However, if I simply move to another Horse record (without closing/reopening the form), the stable is still showing vacant. I have tried using the SaveRecord command in the AfterUpdate of the DateIn...
11
2843
by: kaosyeti | last post by:
i have a form that records 9 fields into a table. on that form i have a 'done' button to close the form. right now, if the form is fully filled in, but you don't press 'enter' before you click 'done', then it closes the form without saving the record. can i change this? thanks. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/200511/1
13
2224
by: Lorne Smith | last post by:
Hi, First, sorry for the crosspost, but it seemed appropriate... :) I've come accross what I consider to be a bug, but I don't know if it's already known or not. (VS .Net 2003 Pro - VB.Net) Whilst playing with inherited forms, I created a simple base form containing a single button. I set this buttons' Click event to be public overridable and put "me.Close" in the code.
2
1020
by: Lloyd Sheen | last post by:
The forms designer has not fixed a longtime (since VS 2002) problem. If you have an embedded UserControl and you make a change to the source, there is no way to open the form and have the property grid deal with it. You can see the property grid but there are not properties. Closing the form and reopening it does nothing and even better all forms behave that way until you close VB and reopen. This is not RAD. One would hope that in the...
3
1552
by: --== Alain ==-- | last post by:
Hi, I've created a Form just for testing purposes. on this form i have a custom control that i created. Every time that i update my custom control (dll file), my test form displays the following message : "One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project,
5
7345
by: deekay | last post by:
I want to allow users to resize and reposition columns of a datasheet but for a prompt to be brought up and only the layout only to be saved if they select "save changes". This is the way it works at the moment for queries but for datasheet forms I find that it automatically saves column positions and widths without prompting to save changes. I should mention i am using Access 2000
6
3219
by: =?Utf-8?B?ZHNoZW1lc2g=?= | last post by:
Hello, I have a windows form with a TreeView control. When I first open the tree all nodes are colapsed. Then, I expand some of them and close the form. When I call Form.showDialog() once again all nodes are collapsed again. I would like the layout to be saved (nodes which I expanded should stay expanded). I don't change the ImageList, Scrollable, CheckBoxes or StateImageList properties of the control between closing and reopening the...
8
4396
by: Phil Reynolds | last post by:
I have a single text box (a large one) in a form that pops up. I want the text box to change size as the user changes the size of the form. However, doing me.txtbox.width = me.width doesn't work, as the width value of the form doesn't seem to change, even as the form is resized by the user. How can get the textbox to always be the same size as the form that contains it?
0
8365
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8883
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8788
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8563
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8646
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6203
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2776
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.