Re: Subform and Form

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: bdehning (bdehning_at_discussions.microsoft.com)
Date: 12/27/04


Date: Mon, 27 Dec 2004 15:25:01 -0800

Steve,

Thanks for setting me straight again on my structrure.

What I had done was base my form and subform on the tables instead of
queries which worked much better to bring fields from all 3 tables as you
noted. I had the child and master links but was doing what you noted as bad
structuring of a relational database and was trying to get field results in
tables that was not needed based on the database structure. The right join
was a result of query I needed to join until I redid my database as you so
nicely pointed out.

This should also help me with any other bad designs that I may have done as
well which may cause some queries to be modified.

Thanks again.

"Steve Schapel" wrote:

> Brian,
>
> The first query contains a [Service Calls].[Policy Number] field which I
> have already advised you to remove from this table.
>
> The second query is already based on all 3 tables, so you should be able
> to include any fields you like from these tables. However, you have a
> RIGHT JOIN between the Account Information and Location tables, which
> doesn't seem to make sense. What was your purpose in doing this? It
> means to return all Location records, even if there is no matching
> Policy Number in the Account Information table, which should never
> happen (as I understand it).
>
> Also, the idea of a form based on a query with all 3 tables would be
> very unusual in this type of design. The whole concept of a
> form/subform construct is that the main form and subform are based on
> tables or queries which are in a one-to-many relationship to each other,
> and which "work" by way of the link between them as defined by the
> subform's Link Master Fields and Link Child Fields property settings.
>
> --
> Steve Schapel, Microsoft Access MVP
>
>
> bdehning wrote:
> > Ok, now that you helped straighten me out on that here is my current issue
> > then!
> >
> > I have two forms which I use to enter fields. One form has a subform and
> > the other is a form with many fields showing existing data and users fill in
> > the remaining fields. Both of these forms use fields from all 3 tables.
> > Each query for the form on its own will show the Account Name and Policy
> > Number for each record. But when I try and join these 2 queries together,
> > some of the records leave the Account Name and Policy Numbers blank. Here
> > are the 2 queries.
> >
> > SELECT [Service Calls].[Policy Number], [Service Calls].[Service Call
> > Number], [Service Calls].[Account Name], [Service Calls].[Location ID],
> > [Service Calls].[Date Call Completed], [Service Calls].[Date Written Report
> > Sent], [Service Calls].Comments, [Service Calls].[Assigned Consultant]
> > FROM [Service Calls];
> >
> >
> > SELECT Location.[Assigned Consultant], [Service Calls].[Service Call
> > Number], [Service Calls].[Scheduled Service Month], Location.[Location
> > Address], Location.[Location City], Location.[Location State],
> > Location.[Location Zip Code], [Service Calls].[Date Call Completed], [Service
> > Calls].[Date Written Report Sent], [Service Calls].[Cancel Service Call],
> > [Service Calls].[Waive Service Call], [Service Calls].Comments, [Service
> > Calls].[Rescheduled Service Month], [Service Calls].[INITIAL EVALUATION],
> > [Service Calls].[PROGRAM/MGMT EVALUATION], [Service Calls].[JOBSITE SURVEY],
> > [Service Calls].[OPERATIONS SURVEY], [Service Calls].[LOSS ANALYSIS],
> > [Service Calls].[ACCIDENT INVESTIGATION], [Service Calls].TRAINING, [Service
> > Calls].[SAFETY MEETING], [Service Calls].[ACTION PLANNING], [Service
> > Calls].[PROGRESS REPORT], [Service Calls].[INDUSTRIAL HYGIENE/ERGONOMICS],
> > [Service Calls].[PHONE SURVEY/OTHER], [Service Calls].Evaluation, [Service
> > Calls].Recommendations, [Service Calls].[Call Type], [Account
> > Information].[Account Name], [Service Calls].[Type of Service], [Service
> > Calls].[Service Call Type], [Service Calls].[Assigned Consultant],
> > Location.[Policy Number]
> > FROM ([Account Information] RIGHT JOIN Location ON [Account
> > Information].[Policy Number] = Location.[Policy Number]) INNER JOIN [Service
> > Calls] ON Location.[Location ID] = [Service Calls].[Location ID];
> >
> > Can you help me so that all records will show Policy Number and Account Name
> > when I join these 2 queries in one query? Does this make sense?
> >
>



Relevant Pages

  • Subform and Form
    ... The Problem is that 2 fields that are in the Account Information Table are ... not in the Service Call Table after the subform is completed for an account. ... so the Account Inforamation and Policy Number will ...
    (microsoft.public.access.forms)
  • Re: incorporate a combo box and text box within same listbox
    ... Link Master Fields properties of the subform to assuming this is ... > control source set to the table account and amounts ... > this information get added to my CheckReqAmtsToAccounts ... > amounts. ...
    (microsoft.public.access.forms)
  • Re: Requerying combo box in sub sub form
    ... My main form is named Account and the information on this form is brought ... The subform to the Account form is named Risk. ... AssertionSelect combo box that isn't filtering to the specific assertions ... names of the controls and not the names of the underlying objects.) ...
    (microsoft.public.access.formscoding)
  • RE: How to Retrieve and diplay the details in the form
    ... Did you set the Master/Child links between main and subform? ... "naveen prasad" wrote: ... but when i change the account number the appropriate fields are not changing. ... and get the values of d1 and display in other fields in the form. ...
    (microsoft.public.access.queries)
  • RE: How to Retrieve and diplay the details in the form
    ... Did you set the Master/Child links between main and subform? ... "naveen prasad" wrote: ... but when i change the account number the appropriate fields are not changing. ... and get the values of d1 and display in other fields in the form. ...
    (microsoft.public.access.queries)