473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

counting records

Newbie here - I need help. I am trying to calculate the number of time a particular date was requested. On the 5th request the user should get a message that states that the date is not available.

I have the following tables:

ScheduleTable
*Emp ID
*RequesteedDate
*Confirm
etc..

and

DateTable
*Date
*Tally (number of times requested)

Can anyone tell me how to do this?
Oct 22 '06 #1
4 1294
PEB
1,418 Expert 1GB
Hi where the user tries to introduce this date in a form? ;)

Or elsewhere?

If in a form this calculation need a VB to do the check and show the message...

In your field in Before Update property choose event procedure and type:

If dcount("[Mydate]", "Mytable","[Mydate]=Cvdate('"+Me![YourNewDate]+"')")>4 then
Msgbox "PLS STOP"
Cancel=true
End if

So you need to change some things:
Mydate is the field in the table where you do a search
Mytable is the place where you store your data
YourNewDate is the name of the control where you introduce your new date

:)
Oct 27 '06 #2
Thanks for the reply. I finally have that part working but now I have another problem. The employee enters their employee ID in the form EmployeeIDInput. I need to take this ID and pull thje record from the Employee Table, which I have done with no problem. this table is has a one-to-many relationship with the schedule table. So one employee may have several days scheduled off. The form where I want to view this information is called PTO Request Date (which has fields from the employee table and the subform from the schedule table).
It tells me that the form PRO Request Date is not found. I suspect there is a step I have forgotten.

Here is what I have so far.

Dim strSQL As String
Dim strSQL_insert As String
Dim strRequest As String
Dim stLinkCriteria As String
Dim testString As String
Dim EMPID As String

EMPID = Me.EMP_ID1
strSQL = "SELECT * " _
& "FROM [EMPLOYEE TABLE] " _
& "WHERE (([EMPLOYEE TABLE].EMP_ID) = '" & EMPID & "') "


Set dbCurrent = DBEngine.Workspaces(0).Databases(0)
Set rsData = dbCurrent.OpenRecordset(strSQL)
testString = rsData.Fields(1)


stLinkCriteria = "Forms![PTORequestForm]!EMP_ID = Forms![Employee ID Input]![EMP_ID1]"
DoCmd.OpenForm "PTO Request Form", , , stLinkCriteria, , ,acWindowNormal

Me.Refresh

rsData.Close
dbCurrent.Close
Set rsData = Nothing
Set dbCurrent = Nothing

Exit_SubmitButton_Click:
Exit Sub

Err_SubmitButton_Click:
MsgBox Err.Description
Resume Exit_SubmitButton_Click


End Sub


Hi where the user tries to introduce this date in a form? ;)

Or elsewhere?

If in a form this calculation need a VB to do the check and show the message...

In your field in Before Update property choose event procedure and type:

If dcount("[Mydate]", "Mytable","[Mydate]=Cvdate('"+Me![YourNewDate]+"')")>4 then
Msgbox "PLS STOP"
Cancel=true
End if

So you need to change some things:
Mydate is the field in the table where you do a search
Mytable is the place where you store your data
YourNewDate is the name of the control where you introduce your new date

:)
Nov 3 '06 #3
Killer42
8,435 Expert 8TB
It tells me that the form PRO Request Date is not found.
...
stLinkCriteria = "Forms![PTORequestForm]!EMP_ID = Forms![Employee ID Input]![EMP_ID1]"
DoCmd.OpenForm "PTO Request Form", , , stLinkCriteria, , ,acWindowNormal
Is it just me or do things not match up, here? I see three quite different strings which I believe are supposed to refer to the same form. Is this correct?
Nov 3 '06 #4
PEB
1,418 Expert 1GB
And is it:

PTORequestForm
or

PTO Request Form

?

What is the name of your form?
Nov 4 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: C White | last post by:
A little while back I had a question about counting records and my example was something like this: in my database table i have the following records john ed john rick tom
2
by: N. Graves | last post by:
I have a table with records of games played with a field for players name and another fields is a "WinorLose". One player may play several games to complete a match. I want my report to tell me...
1
by: mjobrien | last post by:
Thanks for the hint Allen (see below). But I am already doing that count as total records read (5)in the report footer. That count is unduplicated for the record not for the field - student ID as...
5
by: chrisc | last post by:
Hello, Hope this is the right place for this... I am creating a testing database for components as they come off a production line. My reports need to select faults that are found, as well...
18
by: ChadDiesel | last post by:
I appreciate the help on this group. I know I've posted a lot here the last couple of weeks, but I was thrown into a database project at my work with very little Access experience. No other...
8
by: johnds | last post by:
This is my third question about eliminating accounting entries in a clinical database, yet retaining the valid record. Latest wrinkle is being able to sum the visits to the doctor, and the units of...
2
by: Viktor | last post by:
I have a problem with counting empty fields in table. For example: I have the field in which i coulld write several solutions. "done", "not done", "send", "not send" etc. In report i want to...
0
by: Chia Lee Lee | last post by:
Hello… I have problem when counting the number of records, which is based on the start date and end date. I have tried to use message box to prompt the result, but the result given is...
7
by: mwang | last post by:
I have sql like this: select count(*) from TRANSACTION transaction0_ where transaction0_.CREATED > sysdate - 10 and exists (select lineItem.TRANSACTION_ID from LINEITEM lineItem where...
8
by: crassostrea | last post by:
Hello and Happy New Year, I have two tables in Access 2003 (Windows XP) with similar, but different, information. We’ll call them table A and table B. I want to count the number of records in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.