One to Many Form in Access - forms

I have a form a manager fills out for each employee once a week as an audit. Currently the form is in Excel. They would like this data to be tracked over time to review for trends. What they are asking for is basically a one to many relationship. Each answer on the form should create a new record in the table rather than one record per audit form. There are 34 audit questions which can result in either yes, no or n/a. Most of my experience is in SQL and Oracle databases so I am not very familiar with Access. They are looking for a form in Access they can input the audit response and then I can create trends and so forth in Tableau.
So for example Rep: Ms. Smith Date of audit: 09/10/2016 then each of the 34 questions with a year or no response. I cannot seem to manage to get the form working without having to enter the reps name 34 times. Any recommendations for an Access newbie?

Correct me if I misunderstood your question, but here is what I would do.
You can create 2 tables, one called Representative, the other Audit.
In the table Representative, create a field Rep_Name and let Access create an AutoNumber primary key.
In the table Audit, create a field Date/Time for the date of the audit, create a Number field Rep_ID, 34 Yes/No fields for your Audit questions and let Access create an Autonumber primary key.
Then in Database Relationships, link your Representative>ID with Audit>Rep_ID.
You can then create 2 forms, one where the User select/enters his name, and a second form where the date is entered/pre-filled and the questions will be asked. You can link both forms using a button.

Related

Access: Adding records with identical data, except for ID

I would like to be upfront. I am by no means an expert or even really all that technologically savy. However, I inherited a training system where the only way to find out if someone was current was to dig through physical file cabinets and try to find the hard copy. I have put together a basic access database to try and improve the situation. It is working okay, but I've run into a problem.
Previously, most training occurred in small enough batches that data entry is not a problem. (No more than 15-20 entries at any one time). However, regulatory changes now mandate the company put everyone through a mandated training course annually. This means all information about the training will be identical, except for the employee ID associated with the record.
Right now I can manually enter this training just like any other, but I have to perform this nearly identical data entry for each of the several hundred employees in the company.
I would like to be able to enter the pertinent details about the training and then have access create an training record for each employee.
The current form asks the user:
Who is the employee that was trained? (The appropriate employee ID # is entered)
Which subject was trained on? (the appropriate selection is made via combo box)
On what date was the training completed? Date picker is used to fill.
What is the file path to the scanned training certificate? (The majority of this field is prepopulated so only the actual file name needs to be typed. For the specific training in question all the employees of the company will be included in the same scanned pdf. Subsequently, this filed will be identical for all employees.)
The fields on the current form are:
txtEmpID – Text box, where employee ID # is entered. Corresponds to
field "empID"
cboTask – Combo box, where the appropriate training
subject is selected. Corresponds to field "reqID"
txtDate – Text box, the date the training was completed.
Corresponds to field "trngDate"
txtFilePath – Text box, file path to the scanned pdf of the physical
training record. Corresponds to field "trngLocat"
I would like to be able to fill in the information for 2-4 but then have access create a record, for each employee in my employees table, where all the data from 2-4 is identical.
Is this possible?
Pertinent Tables:
tblEmployees – keyed on field “empID” which is the employee number.
tblTrngSubjects - Keyed on field "reqID" which is autonumber.
tblTrngRec – keyed on field “recordID” which is autonumber. Relates
to tblEmployees through field “empID”. Relates to tblTrngSubjects
through field "reqID".
tblTrngRec is the table in which the records will be stored.
Other information that may be relevant:
I am using Access 2016.
I once had a copy of Access 2010 the missing manual…but that was in 2010. It has been almost a decade since I did anything more advanced than “docmd.openform”
I greatly appreciate any and all advice. Thanks, in advance.
I admit I haven't worked with access in quite some time, so some of the syntax might be slightly off. You need to know a list of employee IDs that were in that training.
Insert into tblTrngRec(empID,ReqID,txtDate,txtFilePath)
select empID
,25 'You need to enter this manually
,"6/9/2020" 'You need to enter this manually
,"Enter your file path"
from tblEmployees
where EmpID IN (enter a comma delimited list of employee IDs)

MS Access link record from forms

There are two tables, one for Student and one for Borrowed Books. In the Microsoft Access (2010, 2013), it is easy to display a form Student based on the table Student, and other form BorrowedBooks based on the table Borrowed Books with their Record Source pointed.
How to do Form BorrowedBooks showing records for the current student showing on the Form Student one at one time? I'm looking to learn both VBA script and using the built-in controls to achieve the result.
Relationship between has been built. And it's one student to many books relationship.
One VBA approach like:
DoCmd.OpenForm "BorrowedBooks", , , "StudentID = " & Me.StudentID
The real trick is figuring out which event to put code into.
Another option is to use form/subform arrangement - main form bound to Students table and subform bound to BorrowedBooks. Have you looked at Microsoft Lending Library database template?
so if my understanding of your question is clear then you need to join operation on the tables
SELECT *
FROM
student
INNER JOIN borrowedbooks ON (The two table'S related column ie student.pk=borrowedbooks.fk)
you can also add a where clause if you want from here you can state you primary key in student table and it relationshi

Access 2010 - Parent and child forms share the same table

I'm writing a budget database, and while planning out the tables went fine, forms are proving to be trickier.
I have a 'transactions' table, and two queries based off it. The tables and column names are below
'people_to_reimburse' : payee_name, total
'unwritten_checks' : payee_name, amount, description, date_incurred
I'd like to make a form where you can go through the people to reimburse, and there's a subform showing which checks are theirs. Obviously, the payee_name would be the field to link on.
However, in Access's Form Wizard, when I select these two tables, I get an error of:
You have chosen fields from record sources which the wizard can't connect. You may have chosen fields from a table and from a query based on that table.
How would I set up a form like this, if it's possible? If not, why can't I?

Creating long forms in FileMaker Pro

I am creating long forms in FileMaker Pro with many unique questions in each form.
Each unique question is comprised of: a radio button, two fields of support data, 4 container fields, and a field for comments. There is also a map feature that collects the device location when using an iPad.
Because each question is unique, I have been creating up to 8 fields for each question. The forms I am creating contain up to 40 questions.
Example fields:
Question1
Question1_Comments
Question1_Value1
Question1_Value2
Question1_Image[1], Question1_Image[2], Question1_Image[3], Question1_Image[4]
Is there is a simpler way of approaching this?
Yes. I can offer some general suggestions, but it sounds like you need to normalize your data. Whenever you start creating fields of the form Field1, Field2, etc., that's a hint that you should probably create a separate table. In your case it sounds like you need at least three tables:
Forms
Questions
Files
This is going from the information you've provided that each form has many questions and each question has many files (container fields). Assuming that your form table already has a primary key field (a field that is unique for every record, often an auto-enter serial number), the Questions table would have the following fields:
id (primary key)
form_id
question
comments
value1
value2
Then the Files table would have two fields:
id
question_id
file
Then you'd create a relationship from Forms to Questions with Forms::id=Questions::form_id and from Questions to Files with Questions::id=Files::question_id. If both of the value fields will always have data, I'd leave them in the Questions table, but if one of them could be blank, or if you think you may someday want more than two, I'd break that into it's own table as well.
Check the FileMaker documentation for more information on creating relationships.

Use form to create multiple fields in Access 2010

So I have a form I have Vendors fill out when they want to ship to us. It's an excel form that I then import into Access so I can run reports. Sometimes when they send the form back it's in a format in which I have to manually enter the data into our database.
The form looks like this:
The middle section is just for example purposes so it's a rectangle with text in it.
So everything seemed simple enough until I got to the middle section. See in my excel form I have a section for multiple PO's and units. So essentially each shipment can have one to many PO's and Units. Currently I can approach this task with the redundant method of reentering information per PO on the form. But I want to make this simple.
So the task at hand is that I want to have a form field for PO's and Units where I can input multiple lines of information so that when I hit a submit button. It appears in the database on separate lines with the same vendor information.
So if I filled out my form had this in the middle section:
PO | Units
111111 22
222222 33
333333 44
When I hit submit I want it to attach the rest of the forms information to each PO on separate lines so it'd be like:
Vendor | City | State | PO | Units
Nike Memphis TN 111111 22
Nike Memphis TN 222222 33
Nike Memphis TN 333333 44
So how would I go about accomplishing this task?
From your description of the problem and your example of how the data appears to ultimately be stored in Access it looks to me like you are using Access as a spreadsheet and not as a database. This is ok, but you might want to consider normalizing the data to take advantage of the power of databases in general.
For example:
Create a Vendors table whose sole purpose is to keep details about each Vendor you work with. A very basic implementation would have an ID field to uniquely identify each vendor and a Name field for the vendor name.
If Vendors will only ever have a single location you could also store City, State, ZipCode and Email in this same Vendor table, but I suspect having a separate VendorLocation or VendorAddress table would be a better fit long term.
Create a VendorShipment table that tracks the higher level information on your mockup, such as:
ShipmentID (primary key of this table)
VendorID (foreign key back to Vendor table)
Ready Date
Carrier
Estimated Cost
FreightClass
Tracking #
Estimated Transit Time
Finally, create a VendorShipmentDetail table that tracks the information of each shipment, including:
ShipmentDetailID (primary key of this table)
ShipmentID (foreign key back to VendorShipment table)
PO
Units
Any other details that you want to or need to track
Organizing and storing the data in a normalized fashion would ultimately help simplify your data entry \ data management process and potentially make for a better user experience.
For example, rather than having to enter the Vendor Name, Address information, etc. each time you could instead use a combo box control that is tied to the Vendor table. If the Vendor exists in the table you select it from the list and you already have the Address information, no need to re-enter it each time. If the Vendor did not already exist you enter it once (probably on a Vendor screen where you maintain the details for each Vendor) and draw upon the information in the future.
You would then use queries to tie the information back together for reporting purposes (de-normalize the information).
The art of database design can take a while to pick up, but a good starting point might be to check out the Northwind database that Microsoft has maintained over the years. It has some examples you could draw from immediately to get a practical understanding of how to use normalization within Access. You can find more information here: http://office.microsoft.com/en-us/templates/northwind-sales-web-database-TC101114818.aspx