PC Review


Reply
Thread Tools Rate Thread

Combo showing non current employee

 
 
swas
Guest
Posts: n/a
 
      14th May 2010

Hello,

I have employees in a table. For a given job sheet form, the employee is
selected with a combobox listing all current employees. All fine.

If an employee leaves, they are marked as no longer current.

My problem is, if an old job record is looked at, the employee is not listed
since they are not current. The combo is blank.

I have gotten around this prior by editing the rowsource for [all current
employees] OR [selected employee].

But this only works in single form. I need it in a continuous form, and not
sure whether the best option is to reference the field in the sql, or have
dlookup, of if there is a more elegant approach I am not thinking of.

Comments appreciated.


swas



 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      14th May 2010
This issue crops up regularly. Essentially, if the combo's bound column is
hidden, and its RowSource excludes the value, then it has nothing it can
show and so it appears blank.

The simplest way around that is NOT to the inactive values, but to sort them
to the bottom of the list so the AutoComplete doesn't go to them unless
there are no matching names.

Assuming a table with a yes/no fields named Inactive (check the box if the
person is inactive), you set the combo's RowSource to something like this:
SELECT ClientID,
Surname & ", " + FirstName & IIf([Inactive], " (Inactive)", Null) AS
FullName
FROM tblClient
ORDER BY Inactive DESC, Surname, FirstName, ClientID;

A more complex solution involves placing a text box over the combo, and
including the client table in the form's RecordSource so you have the name
available to show in the text box. When the text box gets focus, you
SetFocus to the combo, which lists only the active names for the user to
choose from. In general, I think this complexity is unwarranted, and it
still gives problems (e.g. trying to enter an old record once the employee
has left.)

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


"swas" <(E-Mail Removed)> wrote in message
news:1A854409-CF2E-4A30-9E6B-(E-Mail Removed)...
> I have employees in a table. For a given job sheet form, the employee is
> selected with a combobox listing all current employees. All fine.
>
> If an employee leaves, they are marked as no longer current.
>
> My problem is, if an old job record is looked at, the employee is not
> listed
> since they are not current. The combo is blank.
>
> I have gotten around this prior by editing the rowsource for [all current
> employees] OR [selected employee].
>
> But this only works in single form. I need it in a continuous form, and
> not
> sure whether the best option is to reference the field in the sql, or have
> dlookup, of if there is a more elegant approach I am not thinking of.


 
Reply With Quote
 
swas
Guest
Posts: n/a
 
      15th May 2010

Thanks Allen.

That's nice and simple. I suppose depends on staff turnover ...the combos
would grow over time. Could also filter by date for the last couple of years
if a hassle.

Solves my problem though.


Thanks again.


swas

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating Employee hours for the current week lunastu Microsoft Excel New Users 2 19th Aug 2009 09:23 PM
verification of current employee employmnet status =?Utf-8?B?TWFyaQ==?= Microsoft Access 1 25th Aug 2005 10:15 AM
Select most current date of duplicate employee records =?Utf-8?B?U3BvdHRlZCBEb2c=?= Microsoft Access 1 30th Nov 2004 07:46 AM
send email to that employee on the current record in a form =?Utf-8?B?Uy5NYXR0aGV3?= Microsoft Access Macros 3 18th Nov 2004 09:08 PM
Showing Employee names Gary Nelson Microsoft Access Forms 1 31st Dec 2003 06:56 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:55 PM.