A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combo Box to display only "active" records



 
 
Thread Tools Display Modes
  #1  
Old March 2nd, 2008, 06:59 PM posted to microsoft.public.access.forms
Nancy
external usenet poster
 
Posts: 446
Default Combo Box to display only "active" records

Hi,

I have a combo box based on a list of records in table. Overtime I may want
to "de-activate" (Employee.Active=No) records in the list so that a user can
longer chose it from the list, but I don't want previously selected records
from list to be affected.

I added a WHERE Employee.Active=Yes condition to the row source. My
drop-down list no longer displays inactive records, but when I look at
previous entries the record displayed is also blank.

How do I only get this to apply to new records being created?

Thanks
  #2  
Old March 3rd, 2008, 02:50 AM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default Combo Box to display only "active" records

Yes, that's a common scenario, Nancy.

One workaround is to sort the inactive records to the bottom of the list.
That way it can still display the old records, but you choose the active
ones first when typing in the combo.

The RowSource of the combo would be something like this:
SELECT EmployeeID,
Surname & ", " + FirstName AS FullName
FROM tblEmployee
ORDER BY Active, Surname, FirstName;

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Nancy" wrote in message
...

I have a combo box based on a list of records in table. Overtime I may
want
to "de-activate" (Employee.Active=No) records in the list so that a user
can
longer chose it from the list, but I don't want previously selected
records
from list to be affected.

I added a WHERE Employee.Active=Yes condition to the row source. My
drop-down list no longer displays inactive records, but when I look at
previous entries the record displayed is also blank.

How do I only get this to apply to new records being created?

Thanks


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.