Solved

Access 2007 Forms

Posted on 2009-07-11
4
251 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
  • 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 84

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now