Solved

Access 2007 Forms

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2016 importing text files 13 20
zero pad a access form field 2 15
Access on Mouse move 5 30
IIF help, YN field 7 21
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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