Access Form Wizard for Two Simple Subforms - ms-access

In Access 2013, I can't use the Form Wizard to add two subforms. Well, the wizard, to be exact, skips the 'choose the main form' step, and upon completion fails to display the main form, only the header. I've replicated this on another computer.
For example, see 3 tables...
First called 'Users' with an ID (PK) and a 'Full name' field.
Second called 'Music' with an ID(PK), a UserID(Number) and 'Song' field.
Third called 'Movies' with an ID(PK), a UserID(Number) and a 'Movie' field.
The relationships are linking the ID of the Users table to UserID of the Music and Movies tables. All very simple. Distilled to its most simple form.
I use the Form Wizard to add 2 fields to show the 'Full Name' of the Users table and the 'Song' field of the Music table, then all is well, and the wizard produces a workable, if unsightly, Form.
Adding the 'Movie' field on top of the 'Song' field (accessing two other linked tables instead of one) means that the next step, choosing the main form, is skipped and the resulting form is empty is User mode but shows fields (no subforms) in Design mode.
Is this a bug in Access or I'm doing it wrong?
Thank you for you time.
Here's a link to some screenshots and database I made for you (It's a OneDrive shared folder). http://1drv.ms/1yrZyvt

Your problem is exclusively by relation between tables.
You connect USERS to MUSIC and MOVIES for 1 to 1, in this case you need almost one register to see information... and can't add any new in one of other tables.
If you modify the relation and main select of the form, the you can run normally.
Put this on the form and you can see that run perfect:
SELECT Users.FullName, Music.Song, Movies.Movie
FROM (Users LEFT JOIN Music ON Users.[ID] = Music.[UserID]) LEFT JOIN Movies ON Users.[ID] = Movies.[UserID];
Some help for this configuration:
Do relationship on tool.. not on every form. It's more easy to maintain
Do always relations based on main registry (normally 1 to many)
When insert any form into another, you can decide how to see and which field maintain the relation between.
Good luck

Related

Create an access dropdown based on a many to many relationship

I have a database which holds data about audio files.
The main three tables are Volume, Author, and VolumeWithAuthor. A volume can have multiple authors, and an author multiple volumes, so they each have a many to one relationship with the VolumeWithAuthor table.
They look like this:
Volume:
ID- set to autonumber
Volume- the name of each file
Author:
AuthID- autonumber
AuthName- a string with the author name
AuthTitle- Dr., Mr. or Mrs., etc.
They are joined on the VolumeWithAuthor:
ID- autonumber
Volume- linked to Volume.Volume
AuthID - linked to Author.AuthID
I have a form linked to the Volume table. Users need to be able to input authors on that form. So the dropdown has to display the entries from Author.AuthName, and then create a new entry in VolumeWithAuthor.
I created a subform that displays all of the authors for each recording, but I can't work out how to add a dropdown.
I think this is something that is probably fairly basic, but I didn't see any similar questions that had answers that worked for me.
Thanks
Perhaps just a typo in your narrative, but need to select authors to VolumeWithAuthor, not Volume.
Options for data entry:
main form bound to Volume and subform bound to VolumeWithAuthor with a combobox to select author
main form bound to Author and subform bound to VolumeWithAuthor with a combobox to select volume
one form bound to VolumnWithAuthor with comboboxes to select volume and author
Use combobox Not in List event to add new author or volume to those tables on-the-fly during data entry.

Saving a separate record when saving the current record

In my MS Access application the user opens the database to enter research notes (RNs). Each RN record needs to be attached to a project. All research notes entered during the current session relate to a specific project, which the user nominates on the first form. However, the RN - Project relationship is many-to-many. Although a single Project is attached when the RN record is created, other projects can be related later.
So... when I create and save a new RN record, I want to create a join table record with the new RN ID and the ID of the selected Project. I cannot find a way of creating this second record when creating the RN record. Does anyone have a way? Thanks
As June7th implied, It doesn't sound like you have ruled out the normal access forms/subforms approach. create a new database then insert the tables behind your many to many relationship. Then go to the database tools tab and tell access about the many to many relationship. For instance:
next select either of your main forms and then on the create tab select form and access will use the information about the relationships to auto-generate a rather ugly but working form and subform:
Form Prettification is Recommended before giving to actual users. Play around with the circled record selectors and try entering some data. Then check the tables and you will see that they have been properly updated. This approach may not work for your particular case, but try it because it is the easiest and fastest approach. Next approach is to add a button which associates a note and a project then runs some vba to add them to the junction table between notes and projects.

Access changes table Relationships by itself

I am struggling with an issue in designing my Access database.
I am a caregiver, and part of my job is taking clients out into the community. I am attempting to build a catalog of outings to help the employees at our company come up with and store ideas for these. I want to store information for each of up to 5 types of events that clients can do at a location. That information includes the event type, when it runs and doesn't, and how much it'll cost, all of which would be user-selectable. (Separately in the same table, I want to include contact information and information that helps the user search for event locations, such as the ZIP code.) I have attempted to normalize the database by spreading event information across fields in the main table, linked to lookup tables. I am aware that Access has a limit of 32 relationships per table.
To help staff find event types, I am trying to set up a method for categorizing them. That requires setting up nested lookup tables, as shown in the first picture.
If I understand correctly, the additional "copies" of those lookup tables are aliases. When I save the setup for the relationships between those aliased lookup tables, close the Relationships window, and open it again, I find Access has changed them, as shown in the second picture. This happens whether I delete the lookup table information for each field in Datasheet View. I don't understand why it does this or how to fix it.
To answer your question:
In the object browser I see that you have only one table: t_OutingType. Therefore, the "tables" t_OutingType_2, t_OutingType_3 are just aliases; "pointers" to the same table (like a shortcut to a document). When you save the relationships and close the window, the relationship information is written to the metadata of the database. When you re-open the Relationships window Access re-builds the relationship diagram from the metadata, and it does not include the redundant aliases.
Additional advice:
Whenever you find yourself duplicating columns in a table, e.g., Event_1, Event_2, ... a little voice in your head should start shouting "Are you sure that's a good idea?" Imagine if you want to search the database for events that fall on a certain date. With the table layout described above you would need to ...
SELECT ... WHERE EventDate_1 = [theDate] OR EventDate_2 = [theDate] OR EventDate_3 = [theDate] ...
It's almost always better to split the Event information into a separate child table and maintain an association table between the child table and its parent.

MS Access sub-sub forms

I am using MS Access as a front end for a MySQL database. In it I have several tables, all based around the concept of a Household and People (one to many, respectively). From that there are several join tables (such as Ethnicity and Dietary Restrictions) which are many to many. I would like to be able to edit this from a single form in MS Access.
So far I have it set up so that I can edit the household information, view/edit all the people associated with it, and expand the person detail to view 1 (out of 3) of the join tables associated with that person record. I cannot figure out how to get all 3 tables to be visible, does anyone know how to do this?
I would built 3 grids using continues forms, or 3 forms in data sheet view.
You then create a 4 form, and drop in the above 3 forms.
In the master form (which is now a subform), in the on current event, you
place the following command to make the child forms follow this form.
me.Parent.Child1.Requery
me.Parent.Child2.Requery.
In the link child/master settings for child 1, you place:
linkChildFields main_id (whatever is the name of the field in
this sub-form that is used to relate back to the parent table)
LinkMasterFields [MasterForm].[form].[ID]
In the link child/master settings for child 2 form you place
linkChildFields main_id (whatever is the name of the field in
this sub-form that is used to relate back to the parent table)
LinkMasterFields [MasterForm].[form].[ID] ("masterForm" is the name of
the contorl you used to hold the master form).
The "many" to many screen looks like this:
The above is a classic accounting or funds distribution in which we take an amount like $50 and distribute the amount over many accounts.
Sounds like a structure problem, actually. Wouldn't it be more efficient to base your property accessory tables (dietary restrictions, occupations, etc) - properties that a single person might possess a number of - on your personal information table, perhaps keyed to a individual ID of some sort (employers often use SSNs, as they are unique - though in your case, you might just make them auto-generating). Items like Ethnicity, and position within a household are something an individual possesses one of, and would be something you could indeed place within your personal information table.
With proper structuring, and the right query work - you can have a form that allows you to edit all of these properties on a family while keeping referential integrity.

Symfony 2 - create a form with a parent entity filtering the options of the child entity

I am new to symfony and PHP.
I have a problem that I hope someone can help:
supose we have 3 entities.
Groups, specialities, works; works belong to a speciality, speciality belong to a group.
Supose that I want to have a form to create a "work". I want to filter my specialities according to a select with the list of groups ( much like on a travel site where we get the destinations filtered by the origin).
So my form will only have 2 fields. The speciality and a name for the work. But in my view i must have 3 fields, 1 for groups that will filter the specialities and the fields belonging to the form.
Much like a booking flights site I must see the fields from the begining.
This as to be so simple, but I'm really stuck on it.
Thank you
At this moment I can come up with 2 solutions:
1) Use ajax.
On the request populate a selectbox with the groups. when you select one of the groups, all the specialities come into a different selectbox of that group.
2)
Use uri segments. Let the user first choose group, then go to a next page and let them choose a speciality. After that the user gets a form where he fills in the data.