Help with Text Box Displaying Value of Combo

G

Guest

Thank you Pat Hartman (MVP) for this suggestion on how to get a value into a
text box showing the value of a Combo's ControlSource even if the RowSource
for the combo is filtered in some way. This really got my hopes up. I have
been experimenting.

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."

Sorry I'm still not understanding completely. Can someone please offer more
advice? Here's what I've got to work with:

tblCustomer
CustomerID
CustomerName
CustomerActive (Y/N)

tblEmployee
EmployeeID
EmployeeName

tblCustomerLog
CustomerLogID
Date
EmployeeName
CustomerName
CustomerLogNote

I want to accomplish with a form (frmCustomerLog): A drop down list to
choose EmployeeName and a drop down list for CustomerName (cboCustomer). The
CustomerName should NOT be required.

The forms RecordSource would be a query (qryCustomerLog) containing :
tblCustomerLog
tblCustomer
tblEmployee
I guess? or Should it contain only tbl Cutomer Log?

The cboCustomer's record source would be a query based on the tblCustomer
like this:
qryCustomerName
CustomerID
CustomerName
CustonerActive = False

I'd like to have a text box (txtCustomerName) that I can place on the form,
preferably over the drop down as suggested, that displays the customers name
(not the CustomerID) even after making a customer inactive. I'm still not
sure how to specify the control source for the text box.
 

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