473,326 Members | 2,010 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,326 software developers and data experts.

Loop through records in a bound form

I have not coded in years and just recently I have been assigned this task of creating a program that keeps track of write-ups given to employees.

I have a tabbed form that is bound to a query. This query populates all the textboxes on the main form for a brief description of every employee and includes their most recent offense.

What I now need to do is create a "details" section or subform that for the selected employee, loops through the history table and for each them, it needs to display all the different types of write-up given (there are many), as well as the disciplinary action taken.

Any and all suggestions will be welcomed! Thanks in advance.
Mar 22 '16 #1
5 1694
PhilOfWalton
1,430 Expert 1GB
You're a little thin on detail.
What form is your details table in?
Are the Write-Ups, whatever they may be a free entry or do the come from a table? Same question for the disciplinary action.
If the disciplinary actions are from a table, can there be more than one action for each Write-Up?
I presume both tables have EmployeeID and that relationships have been established. I presume you have a Primary Key in your WriteUp Table.
When we know a bit more about your structure, I feel sure more help will be forthcoming.

Phil
Mar 26 '16 #2
Thanks for responding and sorry for the vagueness. Write-ups are disciplinary actions given to employees for different things like excessive lateness, dress code violations etc.

The write-ups when initially given, are selected via listboxes. The list itself is in a table (tblDisciplineType). However, once given, the entire occurrence is stored in the history table. So in the history table an employee may have several entries for different write-ups given.

I have a total of six tables. All relationships are established and primary key (EmployeeID) in all.

The "details" section that I'm asking about is still up in the air as I haven't yet decided how I want to present that information. I was leaning more towards a subform. This subform would be populated querying the history table.
Mar 28 '16 #3
PhilOfWalton
1,430 Expert 1GB
OK, we're making progress. You mention you have 6 tables. Do they include
TblEmployees
TblDisciplineType
TblJoinEmployeeDisciplineType
TblSanctions ??????

No idea what the other tables could be, but you didn't answer the question about whether the sanctions come from a table and whether more than one sanction can be applied to each "Write-Up".
The first critical table is TblJoinEmployeeDisciplineType with a structure something like:-
TblJoinEmployeeDisciplineTypeID Auto
EmployeeID Long
DisciplineTypeID Long
WriteUpDate Date

That will allow each Employee to have as many WriteUps registered against him or her as necessary and equally for example if you consider lateness, all those Employees who have offended.

The TblJoinEmployeeDisciplineTypeID key is unique, and depending on the answers you give to the questions that I have posed, is the next link in the chain to the sanctions applied.

Phil
Mar 28 '16 #4
Hi Phil! Thanks again for the help.

The tables are as follows:
tblDisciplinaryAction (ShortText)-used for listbox selection only
tblDisciplineType (ShortText)-used for listbox selection only
tblDivision (ShortText)-used for listbox selection only
tblEmployee (ShortText, Date/Time, Long/Memo)-All employee info is kept here
tblHistory (ShortText, Date/Time, Long/Memo)-Stores all the write-ups
tblSuspension (ShortText)-used for listbox selection only

To answer your question about the sanctions, yes! An employee can be written up several times for the same offence (ie. Tardyness) while the disciplinary action was simply a verbal warning. However after several verbal warning, they may be suspended for days at a time. And each time that happens, that occurrence will also be entered in the history table.

Here's what a typical employee's information in tblHistory may look like:

EmployeeID,EmployeeName,IncidentDate,IncidentType, DisciplinaryAction,Suspension,Notes

XAVIE212,Prof. Charles Xavier,1/7/2016,Failure to Report Criminal Charges,Verbal and/or Consultation Warning,0,some test goes here

XAVIE212,Prof. Charles Xavier,1/1/2016,Insubordination,Written Warning,0,some more text goes here

XAVIE212,Prof. Charles Xavier,1/8/2016,Chronic or Excessive Absenteeism or Lateness,Minor Discipline (1-5 days Suspension),2 Days, Notes:3rd incident
Mar 28 '16 #5
PhilOfWalton
1,430 Expert 1GB
OK, IMO your tables need re-thinking
As I mentioned earlier. the solution is in the Join Table.
The TblJoinEmployeeDiscipline table will have only one combination of Employee, WriteUp and Date (Can Prof Xavier who appears to be a right pain) commit the SAME crime on any day? In which case you may have to use a DateTime field. These 3 fields combined are the key.
In addition in that table, you need DisciplinaryActionID, SuspensionPeriod (If this is zero, there is no suspension Suspension always in days???) and Notes. That is your history.
You don't need the TblHistory, probably don't need TblSuspension.
You don't mention what TblDivision is for, only how it is accessed.

Phil
Mar 28 '16 #6

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

Similar topics

5
by: Steve Strik | last post by:
My Problem: I have created a database here at work that is exhibiting some very strange behaviour. Essentially the database is structured in a manner where one table is a master record table...
14
by: Abhi | last post by:
FYI: This message is for the benefit of MS Access Community. I found that this prblem has been encounterd by many but there is hardly any place where a complete solution is posted. So I thought...
2
by: Wolfgang Kreuzer | last post by:
Hello all, I am converting an Axs 2.0 application to a2k (I know A2K is not the most current version but Axs 2.0 support ended and A2K is supported in our company amd on every PC). The form is...
1
by: skootr | last post by:
Has anyone seen any COMPLETE bound form examples? By complete, I mean a form that has Add/Edit/Delete capabilities. Every example I've seen on the 'net, in books, and in the VB.Net Resource Kit...
22
by: Br | last post by:
First issue: When using ADPs you no longer have the ability to issue a me.refresh to save the current record on a form (the me.refresh does a requery in an ADP). We usually do this before...
1
by: Kuriandungu | last post by:
Hi guys I've read the posts on Write conflict entered in this forum (along with some from kbAlertz and microsoft) and i have tried all the solutions without success. let me give you some background....
2
by: prakashwadhwani | last post by:
I have a continuous form bound to an underlying table. How do I change the value of one field (all rows) to a particular constant say eg. 1998. Someone on the Group here mentioned I should...
2
patjones
by: patjones | last post by:
Hi: I've got a form called "frmChecks" which is the form that loads automatically upon opening my database. frmChecks is bound to two different tables. The problem is, I want it to open up...
6
by: VivDenham | last post by:
Hi there I am brand new to VBA - a 61 year old lady who likes machine knitting. For the last couple of years, I have been designing an Access database called Knitting Database. I want a...
9
patjones
by: patjones | last post by:
Good afternoon, I have a small bound form that is connected to a single table only. I open it in data entry mode (Data Entry = Yes) from a larger form in my application after a particular text box...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.