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")
Related
The field is a regular text box with a short text parameter. In all of my forms I never once turned it into a combo box. However, in the query with no special criterion, whenever I enter a record and this field, a combo box "arrow" shows up. There is nothing to choose from but if I change the record, it gives me the combo box error that the specified item is not in the list. How do I remove this?
Thanks in advance.
Advise to never build Lookup fields with Lookup wizard in table design. Also don't manually set DisplayControl property on Lookup tab to combobox or listbox. Most likely your design does the latter without setting RowSource property.
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 am looking to update a textbox based on a combo box selection.
For example:
If someone selects the word "Beach Holiday" from the drop down, then the text box will automatically populate with the word "Spain"
How do I do that?
I know I can do something similar to:
me.textbox = me.combo.column(1)
but that's not exactly what I am trying to do. Thanks in advance
Configure your ComboBox to have two columns, with the width of the second column set to 0 so that it is not displayed.
Then, set the Control Source of your Text Box to
=[YourComboBox].Column(1)
The value of the Text Box will then automatically update without the need for Event handlers.
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)
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