combo box not displaying data if limit to list opetion set and displaying item not in list....

C

Chris Strug

Hi,

I have a orders form with a combo box on linked to a list of customers. The
combo displays the customer for the current record and allows the user to
select a customer when entering a new record or updating an old one.

The combo box is set to only display those customers who are "current" or
"live" and are restricted to the contents of the list.

The problem is that when it is setup this way, the form will not display the
customer name for orders where the customer is not live / current.

This is due to the limit to list option being set to true.

Is there a way to work around this. A user should only be able to select
live customers when updating a record or entering a new one. However, the
customer should always be displayed, even if they are not current.

The customer combo source is a query that pulls customer ID, customer name
and a boolean indicating whether the customer is live from a customer table.
The control source is the Customer ID stored in the orders table.

I hope I have explained this clearly enough.

Kind thanks

Chris Strug
 
J

John Viescas

Chris-

One solution is to include the customer table in the Record Source for the
form and add the customer name info to the query. Bind that customer name
info to a text box that you overlay on the display area of the combo box.
In the Current event of the form, you can disable the combo box when the
customer is inactive so that the user can't click into the control.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out" (coming soon)
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
 
S

Sandra Daigle

Hi John,

That's essentially how I handle it too - I go one step further and use a
GotFocus event for the textbox that only does a SetFocus to the combo.
 
J

John Viescas

Ayup. The technique is demonstrated in the Contacts sample database for
Access 2003 Inside Out and explained in depth in the "Assisting Data Entry"
section in Chapter 23.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out" (coming soon)
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
Sandra Daigle said:
Hi John,

That's essentially how I handle it too - I go one step further and use a
GotFocus event for the textbox that only does a SetFocus to the combo.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.


John said:
Chris-

One solution is to include the customer table in the Record Source
for the form and add the customer name info to the query. Bind that
customer name info to a text box that you overlay on the display area
of the combo box. In the Current event of the form, you can disable
the combo box when the customer is inactive so that the user can't
click into the control.
 
C

Chris Strug

John / Sandra,

Thank you for the replies. That's a nifty trick - I hadn't thought of that!

Thanks again.

Chris S.
 

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