Query question

A

azu_daioh

I'm having problem displaying certain data in the combo box.

Table: flagInfo
controls: EE_ID, EntryDate

Table: Employee Name
controls: EE_ID, eeName, startDate, endDate


Form: Claim Details
controls: eeName
control source: EE_ID
Row Source Type: Table/Query
Row Source:

SELECT [Employee Name].EE_ID, [Employee Name].Name, [Employee
Name].startDate, [Employee Name].endDate FROM [Employee Name] WHERE
((([Employee Name].startDate)=[flagInfo]![EntryDate] Or ([Employee
Name].startDate)<[flagInfo]![EntryDate]) AND (([Employee
Name].endDate) Is Null Or ([Employee Name].endDate)>[flagInfo]!
[EntryDate])) ORDER BY [Employee Name].Name;


What I'm trying to accomplish is for the combo box (eeName) to display
only the names of our current employees but at the same time I dont
want the old records to "not" display the names of our prior
employees. Someone suggested to use a start date and an end date to
keep track of new and prior employees.

example:
Entry Date = 06/01/07

eeName startDate endDate
Name1 01/01/06
Name2 01/30/06 05/31/07
Name3 06/07/07

so with the above data, the form with entry date 060107 should only
display Name1 in the eeName combo box.

It seems to work when I switch over from Query design view to
datasheet view where it asks me to enter the value for [flagInfo]!
[EntryDate] -- the datasheet view only displayed Name 1 but it does
not work when I'm in the Forms!ClaimDetails, the combo box displays
all the name from Employee Name table in the eeName combo box despite
the [Entry Date].

Anyone who can help me solve this? or can point out where I need to go
for answers?

Thank you so much,

Sharon
 

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