Combining Combo box with free entry text in Access

V

Vickyflobo

Is it possible to select data from a combo box but then use free text
instead, without changing the combo box table data? ie choose the combo box
info if relevant or write free text instead if more appropriate and storing
the data in a separate table?
 
C

Clifford Bass

Hi Vicky,

You, you can do that. Just set the Limit To List property to No. Note
that this assumes that you are storing the text that displays in a combo box,
not any coding. So if you have a list from your table:

1 ABC
2 DEF
3 GHI

and your field stores the number, you will not be able to enter JKL and
store that. In this example, you will need to set your field to store text
and store the ABC, and so on, along with any freeform text.

Clifford Bass
 
K

Klatuu

Clifford is partially correct.
His example doesn't address you question. If your combo is a bound control,
you can't do it. You would have to use an unbound combo. Then you could use
the Not In List event to update the other table using SQL. But, if you do
select from a list, you would have to use a hidden text box bound to the
field the combo will update and populate the text box from the combo's value.

But in any case, I would find another way to do that.
 
C

Clifford Bass

Hi Dave,

It is true that I did not address what to do if she is wanting to add
the new free text to the table that is the source of the combo box. It was a
little unclear if that was the case. Vicky?

However, if you have this situation:

tblMyData
KeyField
...
Reason (text, say 60 characters)
...

tblCommonReasons
ReasonID
ReasonText

And you have these values in the table:

1 Denied
2 Withdrew

On your My Data form you can have a Reason combo box that is bound to
the Reason field and uses the common reasons table as its source, showing
just the ReasonText information. From it, the user can choose one of the
common reasons. Or the user can enter something entirely different that will
then be stored in the field. So if the reason is "Dismissed" and the user
does not want to add it to the common reasons table, the user just types it
in. That is all. It is stored to the reason field without any coding needed.

Clifford Bass
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top