Writing text to a form record permanently

G

Guest

I have a time card form (it's continuous) that let's users assign their entry
to a client. There is a drop down list of active clients to choose from. If
the list gets too long because of old clients being listed I simply make the
client inactive and they don't show up on the list any more.

Here is the data source for the combo box: SELECT tblPerson.PersonID,
[FirstName] & " " & [LastName] AS Name FROM tblPerson WHERE
(((tblPerson.Active)=-1)); .

I wan't the persons name to appear on the time card record even after I make
them inactive. I just don't want the name to be listed as a choice anymore
in the combo box when entering new time card data. Is there a way to write
the clients name permanently on the form to a text box so that when they are
inactive we can still scroll through old time card entries and know who they
were assigned to?
 
E

Ed Robichaud

Your form can display ALL records even if your combobox lookup control is
filtered to only allow selecting ACTIVE records.
You could use "filter by form" to temporarily suppress showing inactive
records, or better still, add some option buttons to your form that would
run the desired filters. That method could also set the record source of
your combobox, so that when the "Active" button is selected, the combobox
displays only active records, as does your single or continuous form.
-Ed
 
P

Pat Hartman\(MVP\)

The value is still in the record. You just can't see it because of the way
the combo box works. The combobox is bound to the value in its
ControlSource. That is the data that is actually stored in the table. The
field you see displayed comes from the combo's RowSource query. When you
use criteria in the RowSource query that removes entries, the combo can no
longer show them even though it still has a value in the ControlSource.

The solution requires a little thinking outside the box.
1. Modify the form's RecordSource to be a query that joins the main table to
the table the combo's RowSource needs.
2. Select the "visible" value from the new table.
3. Create a new control on the form and bind it to the "visible" field.
4. Change the locked property of the new control to Yes.
5. Move the new control and size it so that it covers the combo completely
except for the dropdown arrow.
 

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