Plz...Help

Dear Guys,
I made a vacation database in which I have vacation form to put the employee 
request. But before I filling the vacation form I want to check how many 
times the employee took the  vacation in the current year i. e. when I select 
the name or ID of the employee in the vacation form a message should show in 
the text box of the form that how many times and days he took the vacation in 
the current year.
I have 2 tables Emp and vacation with one to many relationship
I tried to solve it in many ways I didn’t . Please help to solve it.
Regards 

0
Utf
4/5/2010 1:29:01 PM
access 16762 articles. 3 followers. Follow

3 Replies
758 Views

Similar Articles

[PageSpeed] 26

Nad -

You can display the total days taken using a DSum.  Try something like this, 
but substitute your field and control names.  You can look up DSum in help:

Add a text box to your form, and set the record source to this:
=DSum("[Days]","[vacation]","[EmployeeID] = " & Me.EmployeeID)

or if EmployeeID is a text field, then this:
=DSum("[Days]","[vacation]","[EmployeeID] = '" & Me.EmployeeID & "'")

You can do the same with DCount to count the number of vacation records 
there are.

-- 
Daryl S


"Nad" wrote:

> Dear Guys,
> I made a vacation database in which I have vacation form to put the employee 
> request. But before I filling the vacation form I want to check how many 
> times the employee took the  vacation in the current year i. e. when I select 
> the name or ID of the employee in the vacation form a message should show in 
> the text box of the form that how many times and days he took the vacation in 
> the current year.
> I have 2 tables Emp and vacation with one to many relationship
> I tried to solve it in many ways I didn’t . Please help to solve it.
> Regards 
> 
0
Utf
4/5/2010 3:09:01 PM
Nad wrote:
> I made a vacation database in which I have vacation form to put the employee 
> request. But before I filling the vacation form I want to check how many 
> times the employee took the  vacation in the current year i. e. when I select 
> the name or ID of the employee in the vacation form a message should show in 
> the text box of the form that how many times and days he took the vacation in 
> the current year.
> I have 2 tables Emp and vacation with one to many relationship

We would be better able to help if you supply information about your 
tables.  What fields (and their data types) are relevant to your 
problem?  In other words, how are you recording vacations?

For example, if your vacations table contains a numeric field emp_id and 
a date/time field vdate --- so the table contains one row for each 
vacation day taken by each employee, you could do a GROUP BY query.

SELECT v.emp_id, Count(v.vdate) AS Vacation_Days
FROM vacations AS v
GROUP BY v.emp_id;

But I have no idea whether that suggestion is appropriate for your 
situation.  If you want better help, please give us details.
0
Hans
4/5/2010 3:50:34 PM
Many thanks for your reply.
First i will try your suggestion then i will come to U.
Thanks again for your help.

"Hans Up" wrote:
> 
> We would be better able to help if you supply information about your 
> tables.  What fields (and their data types) are relevant to your 
> problem?  In other words, how are you recording vacations?
> 
> For example, if your vacations table contains a numeric field emp_id and 
> a date/time field vdate --- so the table contains one row for each 
> vacation day taken by each employee, you could do a GROUP BY query.
> 
> SELECT v.emp_id, Count(v.vdate) AS Vacation_Days
> FROM vacations AS v
> GROUP BY v.emp_id;
> 
> But I have no idea whether that suggestion is appropriate for your 
> situation.  If you want better help, please give us details.
> .
> 
0
Utf
4/6/2010 5:29:01 AM
Reply:

Similar Artilces:

Can the retail management software be used to help build an e-com.
I am about to open a retail store and also want to set up a web site. Is there the capability of integrating info from the retail files into the website? New West technology has a great package "down in new orleans" <down in new orleans@discussions.microsoft.com> wrote in message news:97A30580-A242-43DB-89FF-EF44FE70A7A1@microsoft.com... >I am about to open a retail store and also want to set up a web site. Is > there the capability of integrating info from the retail files into the > website? www.nitroasl.com "down in new orleans" <down in new...

"IF" Formula Help #2
Thanks Jack, Worked brilliantly Zac -- Korgan2 ----------------------------------------------------------------------- Korgan26's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1447 View this thread: http://www.excelforum.com/showthread.php?threadid=26138 ...

Need help deciphering this NDR
I messed up and posted this in exchange.setup, I humbly ask for forgiveness as I repost in .admin as well (though I was able to merge all 3 of my back to back post into one long winded read) -- Hi gang, I've got a user trying to send an external message to someguy@absnevada.com He gets an NDR returned that says this: ------------ Your message did not reach some or all of the intended recipients. Subject: Tuesday Summary Sent: 12/13/2004 11:32 AM The following recipient(s) could not be reached: 'someguy@absNevada.com' on 12/13/2004 11:32 AM You ...

Reading XML from Database - Serious Problem
This is long, but it's driving me nuts. I need some adult supervision :-) (and I'm not above bribing for help) I have a stored procedure that I call that returns XML to me. The SP returns 3 recordsets. The first comes as a single XML tag like this: <row recordfound="1" IsExpired="0" /> The second has any number of recordsets that look like this: <contact> <contacttype>Individual</contacttype> <fname>Fred</fname> <lname>Flintstone</lname> </contact> And the third has any nu...

HELP: Excel userform version control issue
Hi All, I have an excel userform that is posted on my companys intranet. The issue I am having is, users are saving this form to their hard drive and then using it(Instead of launching it everytime from intranet), SO basically when I have a new version of form on intranet they still use the old version as they have a habbit of saving it on their hard drive. Is there a way to resove this? something like they would see a popup message saying that "This is an older version that you are using, Please launch the form from Intranet for newer version". Thanks in advan...

Help with a formula to determine data presence in other worksheets in the same workbook
I have a workbook with 20+ worksheets in it. Each worksheet contains a series of columns where generally the 'key' (not a real key but the term will suffice for this example) is in the first column and various attributes of that key exist in subsequent columns. I have a summary sheet as the first one and what I want is a base formula that will tell me if the value I'm looking for exists in a target worksheet (the 'key' column) and if it does, does the value in one of the subsequent 'value' columns match some pattern. I have searched around but I don't really ...

Help with keeping formulas in place!
Hi Hi! I need some rookie help! My situation: I run a youth group, and need to keep track of several hundred kids. know Access is the solution to all my problems, but as an interi solution am trying to figure out a way to do it in excel. I have one workspace with several sheets. sheet 1 - list of all participants and their contact information sheet 2 - copy of all 3rd graders contacts sheet 3 - copy of all 4th graders contacts etc... Goal: I need, while maintain full usability of the first "control sheet (sorting, adding new enteries, updating existing etc..), to hav excel to ke...

Carlos need help
setting up, just email me Using the same news.eternal.etc... "Kue2" <Kue2@hotmail.com> escribi� en el mensaje de noticias:i0fui7$69b$1@news.eternal-september.org... > setting up, just email me ...

Help: Mutiple conditions
Hi all, I have a problem about calculate bonus of the following condition which bother me for a long time. Can anyone help me? What foumula should be used? Thanks How to satify with Bonus scheme 2 (showsin the following), I have trie to use AND(OR(),OR()), but it will give a repeated answer. I think using If funtion seems reasonable, but my answer still can no satify Bonus scheme 3. Name Qtr1 Qtr2 Qtr3 Qtr4 Annual Total _______________________________________ Mary 300 463 300 400 1000 John 430 530 510 503 2050 Tom ...

Help
My Outlook 2000 won't remember my password, which makes it very annoying to have to enter it every time I open Outlook. I've tried checking the box "remember password" when the password prompt comes up. I've tried checking the box "remember password" under Tools>Services>Internet Email Properties>Servers>Incoming Mail Server. I know it's not a function of my Internet mail server (comcast); this works on my other machines. I've also tried uninstalling and reinstalling Office2000, no luck. Any Ideas ? Is there for instance a Registry key th...

Help with expression builder in a select Query
I am a beginer of Access. I have a database that consists of 4 columns/fields of dates. These dates/fields can be filled or can be blank. I call them A, B, C, D. Now I want to make a query or report to retrieve the date data in the column/field of A. The criteria for this: all the dates in field A must be later /larger than those in field B or C or D if B or C or D contains any value. I queried the A,B,C,D from the table that contains these fields. The first criteria I wrote is "A is not Null". But then I want to say if B or C or D is not blank, A must be ...

I am wondering if someone could help me solve this equation
A car wash makes $4000 profit on sunny days and loses $4000 on non-sunny days. Assuming independence, if it is sunny 75% of the days, (and, therefore NOT sunny 25% of the days) what is the expected (daily) profit (or loss) for the car wash? (MEAN = EXPECTED VALUE) Let me know via email or can you please forward me to someone who can help me with this formula? Thank you. "Miles" wrote: > A car wash makes $4000 profit on sunny days and loses $4000 on > non-sunny days. Assuming independence, if it is sunny 75% of the > days, (and, therefore NOT sunny 25% of the days) what...

Excel help on line ~ A general muse.
Just a general query on help, We are dipping our toe into Excel after outgrowing MSWorks with regards to bulk querying, we are involved in the thoroughbred industry and hence deal with records around 65,000- 100,000 We can scrabble around by ourselves, and get by no doubt, but if we need a spreadsheet refining process, is it within accepted practice of this NG, to be able to email a SS to obliging parties for assistance and improvement? I should imagine our requests to be bordering on the "easy" to those with reasonable experience. Of course we would be willing to pay, but recompen...

need help !
hi im trying to make a digital scrapbook page in my publisher 2007 but i dont know how to make it the size i want, i need it 8x8 and when i go to page set up i dont see how can i make it 8x8 its all in cm. what can i do? i need this urgent. thanks -- judy Sounds like in the Control Panel it isn't set for English (United States) To verify and change if wanted: Start Settings Control Panel Regional and Language Options "Select an item to match its preferences....." box From the menu, select English (United States) If that is the region you wish. Now your printer and pro...

SMTP queue is very long all of a sudden
Over the course of a 24 hour period the number of domains in my SMTP queue is now close to 200. All of them are Remote Delivery and retry. A lot of the domains are weird as well - like: asdf.com and hfjk.com Over the past year there were usually maybe 5 or so over any 24 hour period, but now there are tons. I'm kind of at a loss - I clear the queue each morning, but by the next day they are all back. Virus scan doesn't find anything on the server. Has one of the other user machines on my network been infected or have some sort of spyware? Is there any way of finding out what computer ...

If Statement Help
I'm trying to get this to work, and I'm wondering if an If statement is the most efficent way. Anyway. In one row, I have various numbers corresponding to weeks, week #1, week #2, week #3, etc. In a row right below that, I have a number corresponding to shipment quantity. City City 2 City 3 More Cities... Arrival Week 1 3 1 Shipment Quantity 500 400 300 I'd like to see how many total arrivals I'll have in a certain week. Week 1 should return 800 (500+300). Week 2 should return 400. Any h...

Need help with m_wndStatusBar
Inside CMainFrame I have some code that I believe was generated by the framework. It does the Create and SetIndicators for the status bar. if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } I have one user machine (XP SP2) that is crashing on startup. If I comment out the return -1 this machine runs fine. (The status bar is created(with the CAPS, NUM, and SCRL indicators). I attempted to use message boxes to trace the flow b...

Email Re-Direction Help Needed
Hi Here is what I want to do:- Someone sends an email to support@mydomain.com. I want that email redirected to three users. 1 is an external recipient, i.e. someone@otherdomain.com. I've tried adding the smtp address (support@mydomain.com) in the properties window of userA which is fine, but I am unable to add the same address to userB. I then tried this:- I created a useraccount called admin. I added the SMTP email addresses to that account in the AD: support@mydomain.com enquiry@mydomain.com feedback@mydomain.com info@mydomain.com I then logged into the outlook account of th...

Accountextensionbase missing data ? Help
Hi I have a customer who has moved CRM 3.0 to new server by them self and I have converted it to CRM 4.0 Now they have made some custom fields and we are able to save data in these fields on new accounts but not on the old ones. We can save data in the old fields. I then took a look at the database and there is only fields in the accountextensionsbase since after they moved the database. How can I fix this ? They can merge each to a new customer but that would take a long time. Can I do a insert into with data from the Account table or is there another solution ? ...

I maybe going about this in the wrong way... Help
Using text input in a form I need to search through a vertical list in a column until I have identified the row I want. I need to minimise keystrokes to make this an effective method. Once I have identified the row I want I then need to activate the cell so I can apply some editing from my form with an offset. I tried using a filter but I think now i was going about this in the wrong way. Any thoughts...?? Rgds Neil *****Posted via: http://www.ozgrid.com Excel Templates, Training & Add-ins. Free Excel Forum & Business Software***** How about using find: dim FoundCell as range wit...

Clicking on "Help" in Word 2007 results in a blank help window.
Instead of the online help displaying as it should, the content of the Help window is completely blank. The user reports this happened quite a while back, so doing a System Restore would be shooting in the dark. Is there some registry change to make to get this working as it should? ...

crash lost HELP
I am working with publisher 2007 and large files of 150MB. With three files it crashed closing my file!!!! and then when you are trying to open it again it says 'publisher has detected a problem in the file uyou are trying to open. If you are certain that this file came from a trusted....' and then the file is lost!!!!!!!!!!!!!!!!!! Would there be a temp. file somewhere? I do not want to believe that this is happening three times to me and all this work is lost!? Who can help In 2007 there are a couple places the file could be backed up. Do you have Vista? Open Windows Explo...

Office 2007 Help Tab Not Available For All Users
The new Office 2007 Help tab (the "Get Started" tab replacement) appears to have a problem with multiple users. If I install it under my administrator account, then other accounts, including both admin and user level accounts, do not see the Help tab. It appears that I have to manually install it for each of the users on the computer. Has anyone else seen this problem? Also, does anyone have any ways to workaround this problem? For clarification, I am referring to the Help tab located at http://www.microsoft.com/downloads/details.aspx?familyid=CFB1C570-89A8-44B6-B4...

vlookup help linking data between worksheet
hi, I have a master list of students (about 200+ )in one worksheet. On the succeeding worksheets are the attendance for seminars. We have more than 20 seminars in a year. Because of the large no of attendees per seminar, I usually type out a list of the students who came for each seminar, so there will be 20 +attendance worksheets. Not all students will come every time and there are new ones for each session. To update on master list, I will sort each sheet by surname, print it out and type in separate column (date) for each session and typed "P" for present and &quo...

Half-witted dimwit seeks help
Hi, Having read the microsoft manual and not found or understood the answer I humbly ask the following questions..... I have a form for filling in fields in a table. How do I get the form to send the information to two identical but differently named tables? (One table deals with part-time workers and the other with full-time workers) On the form is a comment box. Access limits the number of characters users can enter to 255. Is there any way of increasing this or more preferably is there any way of displaying on the form a countdown of the number of characters left? And finally.......