How to make a single Access form create multiple records - ms-access

I'm relatively new in using Access.
I'm creating a database for questions and answers. Answers are stored in the answertable with the following fields: timestamp, question id, answer text, person id. Each record only contains one answer.
Now, I'm looking for a way that lets me update/enter multiple records at the same time. For instance, the person using the form should be able to fill all respondent's answers, then hit submit. If there were five questions, the result should be five records with only the field 'answer text' differing from the other four.
I've searched on Stackoverflow but the only solutions that are given are in RoR. I'm experienced in VBA, but that's it.
Any help would be greatly appreciated. Thanks.

Your main form should be bound to the table that has one record per person. On that form you can add a subform (default view datasheet) that is bound to the table that has one record per question. You will want to set the link between the main form and the subform to be on person id.
Once you have the subform, you can hide the person id and question id fields.
Before you open the form, you will need to run a query to make sure that all the required questions that the person should answer are already added to the answer table, populating both person id and question id.
You may want to adjust the datasource of the subform to include the question text by linking to the table that is keyed on question id.

Well, if a question should have only one answer, and an answer should have olnly a question, why are they in different tables?
But, if your question table should have more than one answer, its ok.
You cannot edit multiple records in MS-Access in same time. You must to implement a form in GridView mode, wich will retrieve the desired questions, or allow user to add records on it. When user edits all the rows, the user should click a button wich will startup a process that will read the gridView and update the table, one by one.
The smartest way ought to be create a form in gridView mode, linking it to the answer table. Then filter the data presentagion on this form to fit in your desired params. When the user edits an answer presented, this row will be automatically updated in table.

I disagree with your fundamental UI question. One question and one answer on a form.

Related

MS Access rookie - Ask for confirmation before updating a record

I'm trying to create a small MS Access database to ease up my everyday job. The problem is I'm a noob when it comes to databases. I'm trying to prevent the user from accidentaly updating the wrong record.
I have a table of records, some of which are not 100% complete.
I created a query that lists only these incomplete records.
On a form, the mentioned query is fed into a listbox.
I want the user to be able to pick an incomplete record from this listbox and fill in some of the remaining parts of the record in a bunch of text boxes. What I don't like is that the record gets updated as you fill in the form fields (they're bound to the table) WITHOUT any request for confirmation. If the user picks a wrong record at the start, the records are gonna get messy with every text box filled. Or that's what seems to be happening.
Here's my idea of the user form:
Is there a correct way to do this? I could force it all with VBA but I'd rather avoid that and use a more native (correct) solution.
Thank you for any answers.
Table constraints are an important part of database design. Any grouping of elements that together are required should be in their own table. This way the required fields must be entered for every record in that table.
For each data entry step you will have one or more tables representing the required data of that step.
If you are following database normalization best practices this should be simple to achieve because your data will already be broken down in to small elements that can have required fields to complete each record.
If you have a record that contains fields that are filled out at different steps then that is a design smell that indicates your table is not properly normalized.
In MS-Access, the forms will follow these rules set in the tables. You will not be able to save a record that has required fields missing.

How to save row values from one field in subform to main form record? - Access

I have a parent form (frmGroupSession) that has a subform (SubFormParticipants) in datasheet view. The subform is based off a query that selects all participants ([CLIENT ID], [NAME], [ATTENDED]) that had attended a specific group [GroupID] on a specific date [GroupSessionDate]. The parent form saves to a table that logs group sessions (tblGroupSessionLog). I need to save the group's participants [CLIENT ID] to the record within tblGroupSessionLog
Basically, I need to pass data from the subform to the record within tblGroupSessionLog. I'm not sure what the most effective way to do this, if it's possible at all. Ideally, I would like to have each unique participant [CLIENT ID] stored in its own field within tblGroupSessionLog. If there were 20 participants in the subform then each row value from the first column/field [CLIENT ID] would be passed to the corresponding field within tblGroupSessionLog ([ClientID1] thru [ClientID20])
I am relatively new at this. Even asking the question was difficult.
I am not sure what else I can provide to help you wizards with the solve, but let me know and I will.
Thoughts? Ideas?
Access 101 : You have a many to many relationship You should look that term up but in short it means clients can belong to many groups and each group can have many clients. (so bang your data into a normalized structure similar to the following:
First tip make sure to add the relationships under database tools (you should look that up). Access needs to know how the tables are related to manage the keys behind the scenes and sometimes access makes better decisions about automatic form creating when it already knows the relationship structure. Once your data is properly structured access makes it easy to produce functional if much less than styling data entry forms which can also be used as even worse search forms. For instance Click on any table and hit create form on the ribbon and access will create the data entry form form you.
Basic Style tip 1: Always delete primary key fields like ClientID from the form. The field is still there in the form's record source being managed by access. Users almost never need to see any table keys. This gives you a basic data entry form which you can also use to scroll through any clients you have entered using the record selector circled at the bottom of the frmClients.
Play around with the record selector to see how it works. In particular go past the last record and you will find you can enter new clients and access will automatically give them a ClientID. You can also cycle through your Clients and update them using this form it just isn't stylish. In the same way we can make a form for the groups table.
You make a form for the frmGroupSessions table in the same manner as the others but add a step. Replace the text boxes holding ClientID and GroupID with human readable comboboxes. Here is a link to help with that: https://www.google.com/search?q=access+change+text+box+to+combo+box&oq=access+change+text+&aqs=chrome.0.0i457j0l2j69i57j0j0i22i30l2.7503j0j1&sourceid=chrome&ie=UTF-8#kpvalbx=_r0sFYJ7vBcfY5gLz2aTgBw15
Becomes:
At this point play around to learn. Use the Record Selector at the bottom of frmGroupSessions to add and modify data. Play with the Tables and see what happens. Start messing with the form properties in particular the default view. Soon you will have ideas about how the form could be better and you can start figuring out how to style them.

Google Data Studio visualize data by frequency of the value

I have a very simple quiz like app which is basically a question and answer. I want to common mistakes of the user i.e. on which question user is making mistake most of the time. For that I have custom event which logs an event every-time a user answers a question wrong. So if there are 5 questions and user usually answers question 3 wrong than the common mistake for that user is question 3.
But in data studio I am not able to find any formula which gets the number of frequency of event value from the big query data-sets. I am looking for a way to implement this any help would be appreciated.
I am using firebase custom events which is linked to bigquery.
Do you want the output of the table to show the Questions on the left, Frequency on the right?
Or you want the output of the table to show the Users on the left, Questions (common mistakes) on the right?
For the first type, create a table, set Question as dimension, Record Counts as a metric.
For the second type, you can create a pivot table. set User as row, Questions as column, Record Counts as the metric

Access form must be opened twice before combobox values will appear

I have a checklist that is used to perform QC audits. When a reviewer answers a question that requires an exception, a pop-up form will open with the correct exception detail already populated. They then have to provide some further information, which I have set-up in the format of a combobox for a field named 'Condition_Detail.' Some exceptions have only one condition that would be an option in the drop-down whereas others have multiple possible conditions, which is why I don't have that field automatically populated as well. I have a table of possible exceptions and conditions that I have used to create the combobox query. When the database was created, the field the 'Condition_Detail' combobox is dependent on was labeled 'Exception Detail' with a space and in my new table it is called 'Exception_Detail.' I did this because the old data and tables will eventually become irrelevant and I know that it is easier to write code with underscores instead of spaces. I include this information because I had to create a relationship between those two fields in the combobox query so that the database would know they are the same. When I test the database, the form opens as expected with the exceptions already populated (NOT in combobox format - the data appears as text on the form). The issue is that when I select the combobox, it is blank. If I answer the exact same question the same way to trigger the same exception to open in a new record, the combobox does have the correct data in it. I have tried to requery the field both when the form loads and after it updates. It still won't show the combobox values unless I trigger that the form open twice with the same detail populated. An additional piece of information that likely doesn't affect the problem is that the combobox is set-up as three columns so that I can populate two additional fields when the condition detail has been updated. I used the code below to populate that, which works perfectly when I can get the condition detail to appear in the combobox:
Private Sub Condition_Details_Change()
Me.Responsible_Position.Value = Me.Condition_Details.Column(2)
Me.Severity_Description.Value = Me.Condition_Details.Column(3)
End Sub
Thanks in advance for your help!
I figured it out. The relationship I created within the combo box query was unnecessary. The query was searching for values in the table that stored the actual responses/conditions instead of the table that stored the available response options. Because of this, once I had answered the question it knew what to look for, but in the wrong place. Setting up the combo box the usual way with the look-up control value in the form referenced as follows was sufficient to get the combo box to work properly.
Field: Exception_Text
Table: tblPreCloseExceptionDescEnc
Criteria: [Forms]![frmEncompassExceptions].[Form]![Exception Text]

Best way to create a form that changes and gets information from multiple tables and queries

I've been pondering this for a couple of days now, i have a relatively large database with multiple tables, and my goal is to be able to administrate this with a MS-Access application. This is the workflow that i want to achieve:
1. Choose a category of products
2. Choose a specific price list.
3. This lists all products of that category in this price list.
4. Choose an item in the list a
5. this triggers an update in a subform and fetches the data related to the choosen row
6. Choose the price in the subform for that specific type.
This problem triggers some newbie questions:
1. How do i trigger an update in a datasheet from a drop down list, so that the datasheet only fetches products related to that category?
2. How do i make a subform trigger yet another subform to update?
And third but not least
3. Is there any good tutorials or other study material out there?
If theres anything that is unclear please tell me and i will try to clarify the questions, english is not my native language. :)
Access will do a lot without any code at all. For example, if your categories are listed in a listbox, that can be made to cascade to a second list box that shows only relevant price lists. Subforms have link child and link master fields that can refer to fields (columns) or controls. You can have a subset of records in the subform where the link master field(s) are the listbox(es) and the link child field(s) are the relevant related field(s). You can also refer to subform controls in link child and master fields.
You might like to look at the Northwind sample database that ships with all versions of Access, in particular, the Customer Order form.