I have a continuous form that contains a drop down box whos control source is the id of a record in a support table. The bound column is this support element id. The row source of the drop down list is a query that gets 2 text fields based on the id in the bound column... the first text field is simply text that is displayed... the 2nd text field is a color. these are actual number color codes for access that the user can enter in by changing the color of a box and saving that particular color
for each of the records in the continuous form, they have one of these levels... Blank, Red Yellow or Green... I want the field that displays the color name to have its background color changed to the color that is in the 3rd column of the drop down...
Any ideas?
You're looking for Conditional Formatting. This article will explain how to use Conditional Formatting to do pretty much whatever you want with the background colors:
http://msdn.microsoft.com/en-us/library/aa139965(office.10).aspx
Related
So I have a database where I have a list of defined terms that get added to a record.
I have it set up so a combo box displays the terms and these get added to a field.
What I would like is the definition field for the term to appear in a text box next to the combo box.
So far I can get it to display the term by simply referring to it by having the control source be "=[Term]". But what I want is to refer to a column within the query used to get the terms in the combo box.
How would I do this? Is there a way of getting the value from one of the hidden columns of a combo box to appear in another place? Even as hover text would be good...
You would use:
=[Term].[Column](n)
where n is the zero-based index of the column to retrieve.
I have a Social Security field that has an input mask - input mask in table and input mask on field. If I display the field in a form, it shows the dashes. When I put a combo box, the values in the combo box do not show dashes, but when I pick one, it does show the dashes. How can I show the dashes in the values of the combo box? I have searched for this and am coming up empty. You think someone would have wanted this at some time??? Thanks in advance for your help!
You will have add a field/column to the source of the combobox, and display this.
Create it like:
TextSSN: Format([SSN], "YourFormatString")
I'm creating a plant database and in the plant detail form, I'd like a dropdown so the user can select the color the plant is, ultimately this would go on a summary report so all of the colors of the plants selected would show and the user can get an idea of what the plant colors would look like planted.
I'm using the Color Index of 56 colors and I made a table with colors (1-56) and used conditional formatting, but conditional formatting only goes to 50, plus I'm not sure on how to get only the color to show on the dropdown.
Here is idea how to display unlimited number of colors in continuous form or report without using conditional formatting:
Create a table, which contains color ID and a column with stored pictures of desired colors, one pixel is enough, each color in separate row. Column data type - OLE Object, insert Bitmap Image with color sample.
Join this table with your main table by color ID column
Display colors in picture control Bound Object Frame, Size Mode should be Stretch or Zoom, one pixel picture will be tiled across whole picture control
Built-in dropdown cannot show color samples, but you can replace dropdown by form with desired samples, it's not complicated.
I have a continuous subform in a form that shows several reminders - it has roughly 6 columns, and the last column has checkboxes where you can check it off if the reminder is complete. Is it possible to color the box if the last column is checked?
This is a great question! +1! (some people seem to give -1 everywhere)
Conditional formatting is limited to the formatting of text only, so you cant color the check box or its background directly.
Here is a full solution that doesn't even require VBA:
Place a new TextBox over your CheckBox an delete its label
Set it to background so it doesn't cover your CheckBox
Bind that TextBox to the same data field as your CheckBox
Set its font color to white (on white background since you don't want to see the text)
Disable it (since you don't want to enter data here)
Also deactivate it (since you don't even want to place the cursor here)
Now set the Conditional Formatting of this TextBox:
1st Condition: If equals 0 then set background AND font color to white
2nd Condition: If equals -1 then set background AND font color to i.e. red
looks great:
in Access 2007 how can I display text fields in drop down list while bundling to an ID? not while selecting (we can do this by plying with the width field. but what I need after selecting?
Do we create a hidden field that stores the ID?
Your description of how a combo box works is correct. Keep in mind that while you're setting the first column and display length to zero, that means the combo box will then search by the second text column. The combo box will display by that second text column after you select a value. In fact in all cases for typing in a value, even partial matching as you type, a simple select of a value will ALL BE done by the displayed text column but in ALL CASES it will save the actual ID (the first column) into the table that the form is bound to.
So no additional coding or anything if need be done on your part to achieve the above goal and in fact this is pretty much the default as to how combo boxes work inside of ms access.
What makes the combo box is somewhat unique inside of Access is you can have more then 2 columns. And, in the combo box settins you can choose what column is to be selected and saved into the table. And, the combo box has both before update (with a cancel), and after update and also a Not in List event that fires in the case of a user tyring to type in a value that not in the list.
So, the Access combo box is quite flexible. The source for the list or members displayed in the combo box can be based on a table, on a query, or you can even type in a value list that is saved inside of the property sheet. And, another option is to fill the combo box is by using call backs (so, again quite a few ways to fill out the list of memebers for selectiogn).
So, keep in mind there is two aspects to the combo box. There's a so called row data source or how you feed the members that will display in the combo box. Then there is the underlying column (field) that you bind that control to when you select a value. That is in the case when the combo box is bound.
As mentioned, the bound column setting is another property in terms of inside the combo box, and you don't need to write any additional code to achieve that above goal in your question.
Albert Thank you for this excellent explanation.
I found out that the bound column has no effect. Acces take the first visible field and bound to it regardless of what you have in the bound column property.
All good thanks
Omar ( hostitwise.com)