GSuite AppMaker - Populate datasource with distinct values from another table - google-app-maker

I have a simple gsuite app with two data sources. One is a students datasource which stores student name, id, and demographic info. The other is a record of the attendance for the current day and contains name, date, and present (boolean column). Each student is unique and maps to one or more rows in the attendance datasource.
The goal is to be able to pre load the table with a set of students from the students table, leaving the date and present blank. THen the user can go down the table checking the boxes for who is in attendance on that day.
Is there a simple way to pre-load a set of records in the Attendance table based on the students table? Any good examples with explanation?
EDIT:
Here's what a data model might look like:
Students: FirstName:string LastName:string Status:string SiteName:string
Attendance: FirstName:string LastName:string Date:date Present:bool
The Students datasource would contain one record per FirstName, LastName. The Attendance datasource would contain multiple records per student, corresponding to each day that attendance data was captured.
Ideally, when displaying the Attendance table widget, I would pre-populate the table with a list of students for one Site. I already have a date-picker widget that updates all the date column values.

Related

How to add Data to table and Its sub-table simultaneously in MS Access through VBA?

I am very new to MS Access and I don't even know how should I start to approach for the solution.
I have a Table 1, that contains Project No., Part No. and Quantity of parts.
Now I want to transfer this data on button click to two different tables.
Table Order and Table Parts.
Table parts is a sub table of Table Orders
When we add project Number to table Orders, then we get auto-generated ID then based on that Unique ID, Table Parts is linked to it.
As we get ID from Table Orders, we need to create entry into table Parts with that ID that will contain Part Number and Quantity.
Can you please help me this?
I tried creating an append query but its just adding Project to Table Orders, not doing anything with Part No. and Quantity.

Database Schema for Parent-Child Relationships

I need to develop a database schema for a pediatrics database that allows the following:
Store last name, first name, date of birth, and gender for each patient.
Store all applicable guardians that may include mother, father, legal guardian and their relationship to the patient (child).
Identifies patient siblings and their relationship to the patient.
4, Allows for patients to become guardians/parents over time.
Stores phones numbers linked to each individual including patients and parents/guardians.
I'm really locked up on the best way to tackle this problem. I'm considering three tables, tblPatients, tblGuardians, and tblTelephones, but I think this would require multiple entries for parents who have multiple children. I'm sure this problem has been solved in the past, but I haven't found a suitable answer. Any insight would be appreciated.
Allows for patients to become guardians/parents over time.
This is key. If patients may become guardians/parents later, you should probably have a table for "person" that describes any kind of person, and then categorize that person with other tables.
For example
PERSON table defines demographics, (last name, first name, date of
birth, and gender, phone number etc)
PATIENT Table defines patient data with FK, and points to
a specific PERSON, optionally with a unique constraint on
PATIENT.PERSONID to ensure that no two patients are the same
person. Presence of a record in this table implies a PERSON is a PATIENT
RELATIONSHIP table links two PERSON records together and defines a relationship. Person1ID, Person2ID, and RelationshipType for example.
Here's my approach to the problem.
tbl_person, columns:
id
first_name
last_name
birth_date
gender
contact info
other personal info
tbl_patient, columns:
id
tbl_person_id
"other columns related to the patient like reason, symptoms, diagnosis, etc"
tbl_patient_has_guardian(one-to-many), columns:
tbl_patient_id(primary key)
tbl_person_id(primary key)
patient_relationship_to_guardian_type
mother, father, etc
So when adding a new patient record, add the personal info to tbl_person, then reference tbl_person id to tbl_patient.
tbl_patient_has_guardian, one patient can have multiple guardians. The guardians has specific relationship type assigned to a patient, it could be a mother, father, etc.

programatic addition of template fields based on database columns gridview

I have the following scenario where a patient has a list of diseases and I have to show the patient name and the list of diseases as columns in a gridview.
I have the datatable that has patientID, patientName and all the diseases as columns (representing 1 or 0 values based on the disease exists for a member)
If I bind the datatable directly, I will get patient and all diseases with 1 and 0 values
However, I want this gridview to have patientName as one column and all the diseases as other columns and in future if a disease is added, I want a column to be added to GridView as well
The Gridview has patient name under patient Column
and checkbox in everycolumn under a disease (if the disease exists for that member, the checkbox is checked by default during binding)
And as an user, I should be able to check/uncheck those if a new disease affects the patient and update the information to the database.
If, it is a bound field, I am able to do this but inorder to support the case of checkbox and editing, I have to go for a template field and item template, but I am not sure how to do it.
Can you please help me with the code to do that.
Data Table looks like this
Thank you.

How to know what record I am in? Dynamics AX7

Here is the scenario:
In the Sales and marketing > Sales orders > All sales orders
I entered the lines by double-clicking the Sales order number
by doing that I am entering the lines of the sales order.
Now in my lines, there is a button there where I will use to add a syntax where I will insert fields in my newly created table.
I would like to know how can I know what record I am in (before entering the lines/before double-clicking the sales order number). I need to know what Sales order number I'm in as I enter the lines of the record.
In every form the current record of a specific FormDataSource has the same name of the FormDataSource. For example in the SalesTableListPage form the only datasource is called "SalesTable", so the current sales order record is identified in your code with the salesTable identifier.
Every record is extended from [Common]. There you have field TableId. You can get table name with [tableId2name].
You can inspect fields with DictTable and field* methods.

MS Access Query matching month from two date fields

I'm new to Access and am trying to figure out the best way to write a query. I have a table that tracks security entry information for each employee which has an Employee ID field and a date field [ENTRYDATE]. Another table (tblSPACE) lists out where that employee sits and is updated each month with new information. There is a field in tblSPACE which tracks what month the information is from. [ASOFMONTHYEAR]. These two tables are related by a unique employee ID number. What I want to do is have a query that shows the entry information and the corresponding seat that that employee was in for that month. I'm thinking I need to add a criteria into one of the date fields to have it match the month of the other date field? Something like Where Month(tblSpace.ASOFMONTHYEAR) = Month(tblEntry.ENTRYDATE). But of course that doesn't work. Any guidance on how I should go about this? Sorry if I've not explained this well.

Resources