Solved

Access 2007 Forms

Posted on 2009-07-11
4
250 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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

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…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

705 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