Combo box based on union query always selects first item

G

Guest

Hello, all. Thanks in advance for any assistance you might offer.

As instructed by the various articles and posts regarding how to add a
'<All>' item to the top of combo box, I am utilizing the following union
query as the rowsource for my box:

Select '<All Bankers>' as Description, -1 as Bogus from tblPerson UNION
Select LastName , PersonID from tblPerson WHERE (([CoverageOfficer]=-1) AND
(IsNull([InactiveDate])))
ORDER BY Description;

The box populates properly. However, when I attempt to select anything
other than the <All Bankers> item, the selection reverts to the <All Bankers>
item. I've searched high and low with out success to identify a solution.
Any thoughts will be appreciated.

By the way, the PersonID field is a GUID/ReplicationID and serves as the
Primary key for tblPerson.

Thanks
 
G

Guest

Thanks for taking the time to reply.

I verified that the Locked property is, and was, set to No.

Clarification on a couple of points that were omitted from the original post:

- The combo box is unbound

- Selecting an item other than the first item fires the AfterUpdate event fo
the combo box. However, the box still reverts to the first item and the
bound value of the box remains unchanged (i.e., equal to the unique value in
the bound column of the first item).

Thanks again for any ideas.

Van T. Dinh said:
Check the Locked Property of the ComboBox.

--
HTH
Van T. Dinh
MVP (Access)


Jeff Polack said:
Hello, all. Thanks in advance for any assistance you might offer.

As instructed by the various articles and posts regarding how to add a
'<All>' item to the top of combo box, I am utilizing the following union
query as the rowsource for my box:

Select '<All Bankers>' as Description, -1 as Bogus from tblPerson UNION
Select LastName , PersonID from tblPerson WHERE (([CoverageOfficer]=-1) AND
(IsNull([InactiveDate])))
ORDER BY Description;

The box populates properly. However, when I attempt to select anything
other than the <All Bankers> item, the selection reverts to the <All Bankers>
item. I've searched high and low with out success to identify a solution.
Any thoughts will be appreciated.

By the way, the PersonID field is a GUID/ReplicationID and serves as the
Primary key for tblPerson.

Thanks
 
G

Guest

In the code that runs in AfterUpdate, there is a .SetFocus method employed.
Seems like something triggers the combo box to requery when that method is
used to move the focus away from the combo box in question.

Thanks for your help.
 

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