Multi Select list box return to report (1 Viewer)

gilescis

D. Castaldo
Local time
Today, 03:51
Joined
Jan 23, 2006
Messages
106
I have built a small timesheet app for our fire depatment. I want to create a form that allows me to select an individual FF or multiple FF, then when you click on a button it runs a query i have that prompts for date range, then it opens a report that is the timesheet for each of the selected names.

Any Ideas on how to approach this
Your help is greatly appreciated
 

gilescis

D. Castaldo
Local time
Today, 03:51
Joined
Jan 23, 2006
Messages
106
Pbaldy
Thanks for the response, I almost have mine working, I have attached a copy of my db. Would you mind looking at it and tell me why the following happens:

when i open the fromOpenTimesheet and then select my employees, It then needs to run the rptTIMESHEETbystanumber which inturns runs qryTIMESHEETbystanumber. but when I put in the date range of 09/01/08 - 09/30/08 it only returns a vew records with only 1 line of data.

for example,
select the following employees
Dean Castaldo
Shane Harris
Barry Fehl
Brian Hart

You will see that they worked more than 1 day in that mnonth

Thanks
Dean Castaldo
Skyland Fire Rescue
 

Attachments

  • OnCall.zip
    464.8 KB · Views: 166

jal

Registered User.
Local time
Today, 00:51
Joined
Mar 30, 2007
Messages
1,709
I tried to take a look at this but you disabled the main database window. How do I reexpose it ?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 00:51
Joined
Aug 30, 2003
Messages
36,140
Sorry, I was out of town. Can you explain the SHPK field? I don't see how the various tables relate with it. Brian Hart is 25 in the employee table, but that's not the number associated with him in the activity table. Maybe I'm just having a brain cramp.
 

gilescis

D. Castaldo
Local time
Today, 03:51
Joined
Jan 23, 2006
Messages
106
Jal, If you hols the shift key down while opening the mdb file it will disable.

pbaldy,
The shpk is supposed to be my primary key in the tblempList
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 00:51
Joined
Aug 30, 2003
Messages
36,140
Then why wouldn't he have the same value in the activity table? I don't have it in front of me, but I think it was also the key in a shift table or something?
 

gilescis

D. Castaldo
Local time
Today, 03:51
Joined
Jan 23, 2006
Messages
106
He should, Im not sure. The tblEmplist has there name, station#, shift
Could it be a joining issue in my relationship >
 

jal

Registered User.
Local time
Today, 00:51
Joined
Mar 30, 2007
Messages
1,709
He should, Im not sure. The tblEmplist has there name, station#, shift
Could it be a joining issue in my relationship >

Not likely a joining issue. If a table has incorrect data, as seems to be the case here, it's likely that you executed an INSERT query that was imperfect.

An autonumber column is a good way to identify each employee - it insures that no two employees have the same empID#. Therefore the Employees table rightly has this column, as your does (SHPK).

When you do INSERT into another table (in this case tblEmpHours), you have to be sure to INSERT that particular employee's ID# (SHPK). Instead, your tbleEmpHours has SHPK as an autonumber column - this is a second autonumber column which is therefore associating a new empID# with this employee. Not good. In fact, you' ve done multiple INSERTS for a given employee, resulting in MULTIPLE ID#s for him.

To start, then, SHPK column in tblEmpHrs should not be autonumber. (Every table should have an autonumber column though, because it comes in handy, I often name it AutoNum).

One question I have is, is the rest of the data in tblEmpHrs correct? Meaning, do you really want to have multiple entries for a given employee?
 

gilescis

D. Castaldo
Local time
Today, 03:51
Joined
Jan 23, 2006
Messages
106
The tblEmphrs holds the hrs, sick,vac per employee
every day they come in the captain will add his crew and there hrs (24hr) shifts
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 00:51
Joined
Aug 30, 2003
Messages
36,140
I think something is very wrong here. If SHPK is my employee number, then I would expect that number in the emphours table when I work (and no name). It seems like that number is an employee number in one table, a shift identifier in another, and who knows what in the third. Maybe I have it wrong, so maybe you can clarify matters (in more than one sentence).
 

gilescis

D. Castaldo
Local time
Today, 03:51
Joined
Jan 23, 2006
Messages
106
Ok, I will try to explain myself as best as I can.

I am trying to replace our timesheet system which is nothing more than using many many excel spreadsheet files to keep track of our time for shifts work.
I need the db to include a frm and a subfrm. at the top i need to be able to enter the date, shift and station#. Then in the subform i want to be able to enter empname,position,wrkhrs,or if they used a sick day, or if they used a vac day.
A captain will come in at the beging of the shift and he will enter the date and shift and sta#. than enter his crew in the subform. Click on add rec to save data.

Finally I built a report (rptTimeSheetbystanumber) that will prompt from a query the begining dat and ending date and pull the data from the table to print out a timesheet with there total hrs for that month

Thanks
 

jal

Registered User.
Local time
Today, 00:51
Joined
Mar 30, 2007
Messages
1,709
I think something is very wrong here. If SHPK is my employee number, then I would expect that number in the emphours table when I work (and no name). It seems like that number is an employee number in one table, a shift identifier in another, and who knows what in the third. Maybe I have it wrong, so maybe you can clarify matters (in more than one sentence).


You and I seem to be reaching some of the same conclusions. Now I see a third place where SHPK is autonumber. Not good.
 

jal

Registered User.
Local time
Today, 00:51
Joined
Mar 30, 2007
Messages
1,709
And why two different tables for empShift and empHours? The data in empShift looks like hours worked and therefore seems to belong as part of empHous.
 

jal

Registered User.
Local time
Today, 00:51
Joined
Mar 30, 2007
Messages
1,709
I don't know why you have station in two tables. If the emp station can differ from day to day, then I think you should have it only in empHrs table, not in the Employees table (tblEmpList).
 

jal

Registered User.
Local time
Today, 00:51
Joined
Mar 30, 2007
Messages
1,709
I was bored, so I decided to work on this.

I think you need to start over, so I made some changes and created a frmAddEmp for you.

Whereas if you decide to stick with the old setup, I don't intend to help you further, as it seems too much in disarray.
 

Attachments

  • Revision.zip
    27.9 KB · Views: 107

Users who are viewing this thread

Top Bottom