By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

Saving Form Properties when closing & reopening a form

P: 6
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
Share this Question
Share on Google+
2 Replies


P: 8
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.BackColor = VBRed
AnotherField.BackColor = VBRed
Else
FieldName.BackColor = VBYellow
AnotherField.BackColor = VBYellow
End If
Nov 21 '06 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
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

Post your reply

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