473,378 Members | 1,434 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Advice & Form Design Issues

Greetings All, just started out leaning relational DB and access a few weeks ago, and seems that i need some pointers as i can not find any obvious answers (obvious to me).

If any one can answer any of the following questions i would be exceedingly happy. =)

Background: i am designing a TV episode database, basically as a learning exercise..

I have on the main form 7 sub forms as part of an overview/edit mode style. So i can have all the details on the screen at once.

Building them manually i have Master/child control links set correctly, and one sub form when "on_current" .requery the next (via VB), across the 7 subforms. I am *guess* this is how u should do it if u want to go no deeper than one sub form?? any advise on this tack?

Doing this i have ran into an issue... i have each table represented in a subform off the main form, i am having issues setting up one subform, like the rest, and it will not work without adding VB code.

Because the table AVSerialFileSpecifications has two other tables connecting to it with many relationships, i seem to be having trouble with connecting the Disk subfom behaving with the AVSeriesFileSpecificationQuery subform. Setting the Master/child links seem not to be having the desired affect. I kinda understand why the Disk form is not being updated with new records etc etc, and this can all be fixed with VB, checking the Disk table for a match, if non then create a new rec and drop in the value.

Is this the way designing the form i want should be done??? Seems like i am missing something in access that i have to code checks in for this.

AVSeriesEpisodeDetailsQuery form control,
Child Link SeasonKey
Master Link [AVSeriesSeasonDetailsQuery].form![SeriesKey]

on_current: Me.Parent![AVSeriesFileSpecificationQuery].Requery


AVSeriesFileSpecificationQuery form control,
Child link EpisodeKey
Master link [AVSeriesEpisodeDetailsQuery].form![episodeKey]

form on_current: Me.Parent![AVSeriesAudioDetails].Requery
Me.Parent![EditDisk].Requery


Disk **this way it will at least bring up the details of the Disk, but wont allow changes or additions**
Child Link DiskIdent
Master Link [AVSeriesFileSpecificationQuery].form![DiskIdent]


EditAVSeriesAudioDetails
Child Link SeriesKey
Master Link [EditAVSeriesFileSpecificationQuery].form![AVFileKey]

Feb 15 '08 #1
3 1742
Stewart Ross
2,545 Expert Mod 2GB
...Doing this i have ran into an issue... i have each table represented in a subform off the main form, i am having issues setting up one subform, like the rest, and it will not work without adding VB code. .... i seem to be having trouble with connecting the Disk subfom behaving with the AVSeriesFileSpecificationQuery subform.
Hi Mapster. You won't be able to do it the way you are trying to do so - with Disk as a subform - because as your relationship diagram shows the relationship as you have deifned it is the other way about. Your table called Disk is the master table on the one side of the one-to-many relationship with AVSpec. Subforms are always used for the detail (many side) tables linked from the master table.

If your relationship is correctly defined you will need to rethink your form structure (which might not be a bad idea with so many subforms).

As an aside, Access is generally pretty good at linking master-child fields between main forms and subforms - not sure why you would need to ripple updates in VBA code as you mention.

Hope this helps you in moving your project forward.

-Stewart
Feb 15 '08 #2
Thanks for the reply, initially i had the many side of the relationship in a subform but in doing this the form ended up being 6 deep, which seemed like like a bad idea, (maybe not??) and i found putting any code in on_current in the deepest subform ran multiple times.

Also i wanted to use a continuous forms and placing subforms in them didn't seem right.

As i mentioned i am rather a new to this, but not nesting the (many) Disk in a subform inside the AVFileSpec subform meant that it didn't link correctly, as reading the Master link from another subform worked ok, but when u modify/create an entry that the master is pointing to and the record does not exist in the child, then i have to create code to enter this record into the Disk subform as a new record.

Perhaps keeping the form one level deep is a bad idea for what i am doing, so 6 levels is the way to go if i want everything on the main form at once?

M.
Feb 15 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
HI again Mapster.

Subforms have a place; if you were designing a DVD rental system you could use a subform to show all rentals for each disk, for example. I have a feeling that you are using them when there are other, simpler solutions available.

I am wondering if you are using the subforms simply to display the linked data from the other tables, adding new data to these as you go? If you are using them to display the fields there is a far, far easier way to do so - which is to create a query that includes the fields from the master table and all relevant fields from the linked tables, being careful to take the key fields from the one-side tables and not the many-side tables (to avoid the query becoming read-only). Your edit form can then show fields from the many-side linked tables as well without using any subforms at all.

If you do go this route be careful in your edit form to set the properties of any control fields displaying values from your linked tables to enabled=no and locked =yes, to avoid accidentally changing values in the linked tables.

On the Disk relationship there is no getting away from the fact that this table is not on the many side of the relationship you are trying to link it to using a subform. When you specify parent and child field links think of these as one and many side links and you will see what I mean - Disk is being linked parent to child (one to many) to a table for which it is the parent (and for which the relationship is actually many to one). One way or another a re-think is necessary here.

I think it is a good thing that you have thought through the design of your database and identified and set proper relationships between the tables. The database will itself enforce the relationships you yourself have defined. It cannot update the Disk table when used in a subform the way you have tried, because it would break referential integrity rules if it did.

Many things can be done in code to get round restrictions that are built-in, but in my view this is not the answer here - you need to define what you want to see on your forms, design appropriate queries on the underlying tables to let you do so, and knit these together using what is likely to be a minimal amount of coding.

Hope your development goes well.

-Stewart
Feb 16 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: pcunix | last post by:
I'm looking for general advice, pointers to web pages, books, whatever. I have a moderately successful web site. The major complaint that I get, time after time, is "It's UUUGLY" As I have...
7
by: dthmtlgod | last post by:
I am creating a online help desk for my office. I am attempting to cleanup my code and I was hoping for a little advice. I have 30 different categories of requests ranging from the desktop...
3
by: Chris | last post by:
Modal forms are great for locking the user out of non focused forms allowing tight control over program flow, but they have one side effect which user find very irritating i.e. Access cannot be...
3
by: Tim Marshall | last post by:
I would swear that when I developed in A97, I could change the back colour of a form. However, in Windows XP, on both A97 and A2003, there no longer is a property showing in the format tab for...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
5
by: Mike Labosh | last post by:
In VB 6, the Form_QueryUnload event had an UnloadMode parameter that let me find out *why* a form is unloading, and then conditionally cancel the event. In VB.NET, the Closing event passes a...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.