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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access 2000 - Changing Subforms within a form

Status
Not open for further replies.

jezzaf

Technical User
Jan 24, 2001
1
0
0
GB
Heeellllppppp. I've got to a sticking point and the books and Help function don't seem to get me any further.

I have a number of tables and I would like to display the information in one form. I don not wish to display all of the tables at once, only one at a time.

I thought of doing this by having a main form with buttons on and then having subforms that would change when the various buttons are pressed.

I understand that the code:

stDocName = "DaltonTest"
DoCmd.OpenForm stDocName, , , stLinkCriteria


will open a new Window with the form in but this ain't what I want. Does anybody know of a way of opening a form in the way I want, or am I totally going around it in the wrong way?

Any help would be much appreciated.
 
One thing I've learned over the years is that if you fight with Access over user interface issues, Access will win. You can't fight City Hall.

However, if you really, really want to house six tables in one form without joining them, I think your subform idea will work as well as anything can. Just use your selection buttons to hide all the subform controls except the one corresponding to the button, which you unhide. I can't guarantee the performance will impress anybody when you open the main form, though--Access will have to run the queries under all the subforms before it displays anything.

There is another possibility in the special case that the fields you want to display are all the same regardless of which table they're in. In this case, you could use just one form and change its Record Source to the appropriate table. Refresh the form and you're done.

Rick Sprague
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top