How do I split a table into two tables? For example, I have a form of classes (in school) and semi form of students that study in the same class (just first and last name), and made a report for this form that above there are the details of the class and below there is a table of all the students with their name and last name. I wanted to ask how do I split the table to not continue page number 2
if I have alot of students so when the table reach the end of the page it will continue on the other side of the page (small table)?
I don't think you actually want to split the tables if you are designing a report. What you want to do is adjust the report so that the field for Class the students are studying is in a group header. In design mode, click "add a group" and then select the Class field. Then below that is where you will want to put the first and last names in the detail part.
You can also adjust where the pages split and you will need to play around with the design view options to get exactly what you want.
Ultimately, I think you want your report to look something like this:
Geometry
Josetta
Scott
John
Mark
English
Scott
Josetta
History
John
Mark
Related
I am new to Microsoft Access and I am trying to build a Case Tracking system for our Employee Relations folks. I have a table for Employees and a table for Cases. They are linked by Employee ID. I also have a form to incorporates fields from both tables so they can fill out when a case comes in. How do I save the data on the form into a master case history table? I want to capture the employee data as it was when the case was added since departments, managers and other fields are dynamic for the Employee. My form includes:
Employee Table
Employee ID,
Company,
Job Family Group,
Cases Table
Case Number,
Case Date,
Case Type,
I know I can obviously write a query to join them, but it will show me the employee facts as they are as of the last data refresh. Any help you can provide would be greatly appreciated! Thank you again.
Actually, the way you approach this?
Well, you have a main form - employees.
Then, you have (make) a sub form of cases.
Now, that sub form can be a grid like display - perhaps you select (click) on a row to show + edit more details, or perhaps just a sub form as a grid (continues form) will suffice.
In other words, you don't make the form update both tables at once, but in fact use a main form, and a sub form.
Say, I have a table of Hotels. And I need/want to display hotel information, and THEN ALSO display people booked into that hotel?
so, I create a form based on table People. That table People of course has a column that relates back to the hotel they are booked to.
So, you get this:
So, each form STILL ALMOST ALWAYS will be based on ONE table. Don't try and make some multi-table join for the forms data source.
So, in your example?
you build a main form - employees - it can show all the information (and let you edit/add etc.) to that form.
For each case, from the case table?
Well, go off and build a 100% separate form for display of "case(s)".
Then save that form. Now, open up your employee form, and in design mode, simple drag + drop in the cases form into that form.
So, you don't actually base the form and its table on more then one table, but you combine multiple forms EACH based on their one respective table.
But, as above shows, the end result is a main form + sub form, and that gets you the relational database setup, and allows you to do this without having to write code.
First of all, I need to say that I never worked with Access or any other databases before. I'm trying to understand how it works and picked "Students" template for this task (see step 0). Now, let's start.
i. Creating the base from the template and fill it with data
Step 0. Creating new database based on "Students" template:
Step 1. On the objects pane (i.e. left sidebar) search for Student List form and double-click on it:
Fill the First Name and Last Name for the first student: it will be Mike Smith.
In the Special Circumstances column it is possible to select multiple circumstances: for example, Circumstance 1 and Circumstance 2. And if you click on the icon below the combo-box, it is possible to edit the list of available check-boxes:
Step 2. After we have created the entry for the first student, double-click on the Guardian List form and create entries for 3 guardians: Jane Roe, John Doe and Jill Joe.
Step 3. Return to the Student List form. Click on the Open cell in front of Mike Smith. It will be opened Student details form for this student. When it will be opened, click on Guardian Information tab - and you will see, that all 3 guardians are available for combo-box:
ii. Now, my task
I want to see the guardians directly in the Student List form - the same way as Special Circumstances located.
I want to get the option to select multiple guardians for each student - the same way as Special Circumstances check-boxes are implemented.
iii. How it was solved myself, but only the 1st point of the task
To simplify the task, I will use Student ID column (located on the Student List form), instead of creating new column.
On the left sidebar - click on Student List form with right mouse button and then select Design View. When Design View will be opened, select Student ID field, right click on it, then click Change To and Combo Box:
Then, on the right sidebar select Data tab, set curson inside Row Source field and then click small ellipsis (...). In the Show Table window select Guardians and then click Add button and close this small window.
Then, in the large window, do this:
And then click Save As and Close on the ribbon.
Then, switch the Student List form back to the Layout view (the same way, as we switched it early to Design View). And you will see that the first point of my task is solved: the last names of guardians are available in Student ID column:
But how I can implement multiselect, the same way as it is implemented in Special Circumstances column? So, Mike could have both Jane Roe and John Doe as his guardians.
Multi-valued combo boxes are very odd controls. Avoid them whenever possible.
Creating an unbound multi-valued combo box is not possible (see How can I create a Multiple Value Combo box on an Unbound Form). A combo box is multi-valued when the field it is bound to is multi-valued, or when it's set to a multi-valued lookup.
To change a field to a multi-valued field, you need to alter the table design, and set the Allow multiple values property to Yes:
This will automatically change any combo boxes bound to this field to multi-valued combo boxes.
Note that I highly recommend not using this approach. This database already demonstrates a junction table, the recommended way to manage many-to-many relationships. Using junction tables and multi-valued combo boxes is not possible without using very hacky techniques.
I want to create a rdlc report using Microsoft Report Designer. Due to complexity of my data (the given below is just an example) I do not use View on Database side. So, I have to use seperate tables (data sources) for my report design. Now, as it can be seen the example below I have one report page and I want to show PERSONAL, FAMILY and JOB INFO for each person.
There are Textboxes on PERSONAL INFO section. The data is come from table_Personal,
There are a Table on FAMILY INFO section. The data is come from Table_Famiy,
There are a Table on JOB INFO section. The data is come from Table_Job
and all the three tables contain Person_Id column.
PERSONAL INFO
Name : Christof
Surname : Robin
Age : 45
FAMILY INFO
No----- Name----- Age----- Birt Place
1------ Sarah----- 12------ London
2------ Albert----- 16------ Manchester
3------ David----- 23------ NY
JOB INFO
No------ Company----- Start Year
1------- Xyz----------- 2005
2------- T Mobile------- 1999
3------- Day Inn------- 1993
My question is;
1) I do not want to use Subreport and do not combine these tables in db side by using view (I have searchhed, but for 3 or more tables it is impossible I think).
So, is it possible to create a master-detail report like above by grouping items (table, list, etc.) and without using subreport on rdlc? If so, could you explain a little bit please?
2) I have tried to create such a kind of report like that; I use a List and inserted all the textboxes and three tables above
to this list. I assign all the three tables as Report Data Sources. I make List.DataSetName = Table_Personal and List.Grouping settings
select Group on : Person_Id and some other combination. But, unfortunately I have not managed to create such a kind of report group like above.
Could you help me please by giving some advice and if you have some sample rdlc page source please? ...Shohel
Yes it is possible but I'd done it like 6 months ago, so I don't have any sample code right now.
I have done a lot of similar cases. One such case is there are a list of students and each student has a list of marks, a list of achievements, etc.
If I remember correctly I used one storedprocedure to get all the details of all the students. One dataset. And put 'em all in one tablix and grouped 'em.
The sub-lists (like the list of marks) are separate tablixes themselves and are inserted in textboxes of the main tablix.
Hope it helps! :)
I know only the basics of Access, so I am having trouble figuring out how to make a form that will access multiple unrelated tables.
My problem:
I have several tables which describe different card collections. There is no way that I want to link them, even if I could, e.g. by card names. This is because I want to keep the listings separate. I do, however, want to create one form that will access them all, so that I don't need to fiddle about clicking on different forms every time I want to update a card database. The more tables I include, the less practical this would get, anyway. I've tried looking this up and there are several sites which seem to suggest sql-like statements as solutions, but frankly these fly over my head - I don't even know where I'd write them!
So what I want is one form that has a combo box menu to select the table that I want to edit, then another box to select the card that I want to see and hey presto I can edit the details of that card. I can do this if I make one form for one table, but I don't know how to do it for many tables. I would also like it to check for new tables should I add them in. E.g. cards have different series that come out, so when a new one comes out I will create a new table for it, add the cards and so on...
I realise this is probably quite fiddly, especially in Access, but if anyone can give me some guidelines on how to do this it would be much appreciated. (I'm using Access 2007)
To answer your question:
Use subforms. Create few subforms and your combobox and hide/show the forms as you desire.
Better way to do it:
Creating separate tables for each card type is quite a bad practice. If the cards share features like MonsterName, MonsterPowerType or whatever, you should create another table like card_types and add a card_type field to the cards table. Then if you need to get only Pokemon cards create query with card_type_id = xx or card_type_name = "Pokemon" criterias.
This way you only need one form and you can change the card_type criteria with use of your combobox.
This is quite old, but it might help others. I did figure a way to do exactly what you asked
I only have access 2016, so things might be in a different place, but not that much.
First, create all the tables for each of your decks. Make sure you have in the first column : unique ID, second column the name of the deck (it's going to be the same for each entry in this deck) this is going to help us. The third column the name of the card. The other columns will contain your other values of your card, but for my example it doesn't matter.
I'll name them like this
column name
1 unique_ID
2 DeckName
3 CardName
Now, in the tab "create" choose "Query Design". Then in the tab "home" in the seciton Views, choose SQL.
in the blanck section enter this
I have 2 tables :
Table1 and Table2
SELECT Table1.DeckName FROM Table1 UNION SELECT
Table2.DeckName FROM Table2;
You have to add each table and add a UNION between each. You finish the sentence with one semi coma only ;
Click run and you should get all the DeckName.
Save your query and close it.
Now, we want the combobox to help us choose between the different decks.
in the tab "Create" choose "Blank Form". Go to "home/views" choose "design". In the "design" tab, choose the combobox. You can click cancel and skip the wizard
In the property, click "rowsource" and select the query you have created.
Name it Cmb_Deck
Add a second combobox
Name it Cmb_Name . property "Column Count" put "2" because this combobox will show the name of the card, which is column2 in our tables.To be a little bit fancy, we will hide the first column, in the property "Column Widths" put "0";1"" (first column 0inch, second column 1inch).
Drag any of the table you have create into the form and click cancel when the wizard appear.
Name it TableResult
Now that the layout is created, we need to change the table according to the combobox Cmb_Deck.
In the Cmb_Deck property go in the event section and choose "After Update" click on the "..." and choose Code Builder
In this Visual Basic editor window : delete everything that is there and enter this
Option Compare Database
Private Sub Cmb_Deck_AfterUpdate()
TableResult.SourceObject = "Table." & Cmb_Deck.Value
Cmb_Name.RowSource = "Table." & Cmb_Deck.Value
End Sub
Private Sub Cmb_Name_AfterUpdate()
Me.TableResult.Form.Filter = "([" & Cmb_Deck.Value & "]." & "[CardName]=""" & Cmb_Name.text & """)"
Me.TableResult.Form.FilterOn = True
End Sub
Now back in access, select your combobox Cmb_Name and go into property event/afterupdate and choose "[Event Procedure]
Now in your form, go to home/views and choose Form Views. First choose a deck in the first combobox, then choose the name of a card in the second combobox. Now the table underneath, shows only the card that you want to see.
I hope this helps
-Mathieu Paquin
I've been researching around a lot and I just can't find something I think should be very easy to someone with very little experience with Access 2007.
I am trying to create a report. The db has two tables. One with account, name and address. The other has account and product Id. The tables are joined on account. One customer/acct can have several product Ids.
I need to create a mailing that will have rich text in the body and list per account/customer the products they have.
I keep running into having the rich text(body of letter) showing each time the product Id is listed. Do I need to create something in code first? Like an array with the product Id so I can have it as one variable per account/customer? If so, where should I create this? In code, macro or expression builder?
Getting kind of frustrated I guess. I'm tempted to write something in C# as I have enough knowledge I think to make this happen, but I prefer to keep it all in Access. I might also be asked to keep it in access and c# is not what is used currently where this project is being built.
Rogue:
You should use a page header on your report containing the formatted customer/account info, probably: "Dear Account:... " You're treating each id as a separate form letter. What you want is each customer to get the letter via treating the customer as a page header and group footer, while the id's go into the details.
Then, the one or more products would be in the detail section.
The closing of the letter would be in the group (customer info) footer: "We look forward blah., blah sincerely.....
Then, set the property of the group footer to "force new page after section", meaning when you get to a new customer, eject to a blank page and start printing another letter.
Hope this helps.