Solved

Access 2007 Forms

Posted on 2009-07-11
4
256 Views
Last Modified: 2012-05-07
I have designed a database that contains the following tables:
CUSTOMERS (Primary Key: customernumber)
SITES (Primary Key: sitenumber)
RADIOS (Primary Key: radiornumber)
NETWORK EQUIPMENT(Primary Key: equipmentnumber)
INCIDENTS (Primary Key: incidentnumber)
In the relationships SITES is connected to CUSTOMERS via the customernumber field. All other tables are connected to the SITES table via the sitenumber field.
My issue is with the form. I can create a form that contains the CUSTOMER info and the respective SITES however when I drop a tab onto the form and create a separate tab for RADIOS, NETWORKEQUIPMENT, and INCIDENTS, I am only offered a master > child relationship that seems dependant on the CUSTOMERS table and customernumber. I need to link the tab forms back to SITES via the sitenumber field. See the attached screenshots for clarification.

What do I need to change to accompllish this. Ideallly I want to be able to locate a customer, see a list of their sites, click on the respective site and see all associated radio, networkequipment and incident information for that specific site.

ralationships.jpg
formwithpropertysheet.jpg
0
Comment
Question by:telpage
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Expert Comment

by:ErezMor
ID: 24833645
if you want to use the automated linking done by access ffrom sites to it's "children", then you'll need to have those child forms as subforms for sites and not for customers
so open sites form in design view and add the child forms directly to it and save
now open customers form and add sites as cusotmer's child form
so you have the forms reflect the relationship of your tables (sites are customers child, and radios, equipment and incidents are customers "grand-children")
that's as far deep as access will let you go in subforms,
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 24834022
You can keep your current form design/structure if you don't mind doing some coding. Since a Site is related to a Customer, you've got that correct - the Site subform is embedded in the Customer form, and I assume that you've properly related them.

If you want to view the Radio, Network Equipment and Incidents for a specific site, you can do this in the Current event of the Sites form:

Me.Parent.RadioSubformControlNAME.Form.Recorset = "SELECT * FROM w_Radions WHERE SiteNumber=" & Me.SiteNumber

Do the same for your other two subforms.

The trick is the Subform Control ojbect(s) on your main form. To refer to them correctly, you MUST refer to the Subform CONTROL, which may or may not be named the same as the form you're using as a SourceObject in that control. This is tricky, and trips up a lot of developers.

<that's as far deep as access will let you go in subforms,>

I'm not sure what ErezMor is referring to with this, but Access will allow you to go up to 7 levels deep with subforms, although that wouldn't be a wise decisions IMO. Earlier versions (A97, I believe) only allowed 3 levels but that's been changed.
0
 
LVL 12

Expert Comment

by:ErezMor
ID: 24834349
i must admit i didnt even know the allowed depth has changed over 3 levels, sorry for the mis-information
Erez
0
 

Author Comment

by:telpage
ID: 24956915
Thanks for your help on this.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question