Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reasons NOT to use subforms (For navigation)

Status
Not open for further replies.

Spidy6123

Technical User
May 30, 2002
227
CA
Hey,

I want to use subforms for all of the major forms in the project.. ie input, read only, report options..

I want to use the main form as a "container" for all of the other forms..

I'm considering using this method throughout the company (15 or so databases) but I wan't to know the disadvantages before I proceed..

does anyone have any experience or valuable feedback on the topic?

Thanks guys
 
I have tried it once. Kept things neat (didn't have to deal with the messy task of keeping things modal or tracking open forms) and allowed a common set of controls on the parent form to handle subform navigation. But I wouldn't do it again because:

It won't allow the user to open 2 (or more) forms and then toggle back and forth to compare data or to compare and enter data. May not be an issue with your dataset. You can set up a mechanism to allow the user to go back to a specified record on another subform (sort of like keeping a bookmark for both subform and record), but this of course requires a lot more processing overhead to repeatedly load the form and recordset.

My two cents.
Cheers,
Bill
 

Go to Advanced Search here and enter the term subform then go thru the 20 or so hits you get. You 'll get an idea of the problems encoutered using subforms. They obviously have their place, but using them unnecessarily as you suggest is, in my opinion, just asking for trouble! I'd rather get hit in the nose with a brick!

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
hrmm.. thanks for the advice..

I've decided to just put the navigation code in every form.. and just closing the original form while opening the new form..

I have my reasons why I NEED to keep people restricted from viewing more than one form at a time..

anyways.. thanks for the help guys...
 
There are other ways of limiting the user to one form. On each form's open or load event you can loop through the forms' collection and close all other forms. Something like the following:

Code:
    While Forms.Count > 1
        
        If Forms(0).Name <> Me.Name Then
            DoCmd.Close acForm, Forms(0).Name
        Else
            DoCmd.Close acForm, Forms(1).Name
        End If
    
    Wend

Cheers, Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top