PC Review


Reply
Thread Tools Rate Thread

Combo Boxes and dynamic drop downs

 
 
JamesSF
Guest
Posts: n/a
 
      6th Nov 2007
Hello

I have a subform in datasheet view that has a list of people that have
worked on a project.

Some of those people are inactive or no longer employed. I want to see who
has worked on the project but i dont want people to be able to add inactive
or retired or no-longer-emplopyed people to the list.

Whenever i try to change the comboxbow rowsource to exclude inactive people
(via a text flag in the table), it removes the names of the past people.
(primary key is saved in the table and the combobox shows the displayname).

how can see the historical names and limited new names to active only from
the combox in a datasheetview form?

thanks!!
jamesSF



 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      6th Nov 2007
JamesSF wrote:
>I have a subform in datasheet view that has a list of people that have
>worked on a project.
>
>Some of those people are inactive or no longer employed. I want to see who
>has worked on the project but i dont want people to be able to add inactive
>or retired or no-longer-emplopyed people to the list.
>
>Whenever i try to change the comboxbow rowsource to exclude inactive people
>(via a text flag in the table), it removes the names of the past people.
>(primary key is saved in the table and the combobox shows the displayname).
>
>how can see the historical names and limited new names to active only from
>the combox in a datasheetview form?



The word "historical" implies a date when the person became
unavailable to work on the project. Maybe your text field
should be a date field so the form's record source wwould be
able to filter out people that left before the project
started. You could then also use code in the form's
BeforeUpdate event procedure to prevent new records from
being added when the not available date is already set.

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
JamesSF
Guest
Posts: n/a
 
      6th Nov 2007
ok thanks - that works - got me on the right track

is there a better way besides doing a dlookup?

on the before insert, i have it check the table for that person to see if
they have been flagged inactive, if they have, i can cancel and undo the
selection and msgbox the user

JamesSF



"Marshall Barton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> JamesSF wrote:
>>I have a subform in datasheet view that has a list of people that have
>>worked on a project.
>>
>>Some of those people are inactive or no longer employed. I want to see
>>who
>>has worked on the project but i dont want people to be able to add
>>inactive
>>or retired or no-longer-emplopyed people to the list.
>>
>>Whenever i try to change the comboxbow rowsource to exclude inactive
>>people
>>(via a text flag in the table), it removes the names of the past people.
>>(primary key is saved in the table and the combobox shows the
>>displayname).
>>
>>how can see the historical names and limited new names to active only from
>>the combox in a datasheetview form?

>
>
> The word "historical" implies a date when the person became
> unavailable to work on the project. Maybe your text field
> should be a date field so the form's record source wwould be
> able to filter out people that left before the project
> started. You could then also use code in the form's
> BeforeUpdate event procedure to prevent new records from
> being added when the not available date is already set.
>
> --
> Marsh
> MVP [MS Access]



 
Reply With Quote
 
Marshall Barton
Guest
Posts: n/a
 
      6th Nov 2007
JamesSF wrote:

>ok thanks - that works - got me on the right track
>
>is there a better way besides doing a dlookup?
>
>on the before insert, i have it check the table for that person to see if
>they have been flagged inactive, if they have, i can cancel and undo the
>selection and msgbox the user



DLookup is easier and just as fast as any other way. If
speed is critical and if each person is a unique record in
the table, you might(?) find that:
DCount("*", "table", "personID= & Me.personID & " AND
inactivedate Is Not Null")

is a little faster, especially if both THe PersonID and
InactiveDate fields are indexed.

--
Marsh
MVP [MS Access]
 
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
Combo Drop Downs bgomezesthela Microsoft Word Document Management 1 19th Dec 2008 01:55 AM
dynamic drop downs igotyourdotnet Microsoft ASP .NET 4 8th Dec 2006 08:50 AM
Using Drop Downs Or Combo Boxes to Look up and display Info Wyveryn Microsoft Excel Misc 2 4th Oct 2006 02:43 AM
How to clear drop downs and edit boxes? Karl Windows XP Internet Explorer 1 22nd Jun 2004 12:32 PM
Using Drop Downs and Check Boxes Joe M Microsoft Word New Users 1 11th Feb 2004 04:14 PM


Features
 

Advertising
 

Newsgroups
 


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