Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-17-2017, 02:33 AM   #1
tdriscoll
Newly Registered User
 
Join Date: Apr 2017
Posts: 5
Thanks: 4
Thanked 0 Times in 0 Posts
tdriscoll is on a distinguished road
Opening another form at a specific record, based on current form and record

Hello,

I have a 3-tier database (grandparent, parent and child), which I would like the end user to be able to navigate using command buttons.

Currently, I know how to add command buttons using the event builder that can open another form, and at a specific record. So far so good.

However; there are 6 grandparents, 9 parents, and approx. 40 children. Not all parents are related to all the grandparents, and not all children are related to all the children. My current buttons display on a form for all records, including those which do not relate to the record the button will open.

I have set up the many-to-many relationships between each generation/tier.

From the grandparent/parent forms, I would like to have command buttons allowing you to go the next level down, to the parent/child related to the grandparent/parent record displayed.

As I scroll between records, I would like for these buttons to stay the same, but their attached events to change.

I'm imagining this should be possible somehow using the relationship join tables and/or record ID numbers.

If this downward journey is possible, it follows I could go up the family tree in a similar manner.

For Example: From Grandparent 1, I want to be able to open the parent form at records 1 or 3. From Grandparent 2, I want to be able to open the parent form at records 2 or 3. The grandparent form would then only need 2 or 3 buttons.

Likewise, from Parent Form record 1, I would like to be able to go the Child form, and open records 1, 2, 3, 4, or 5 etc.
From Parent record 9, I would like to be able to open Child form, record 35, 36, 37, or 38....

Many thanks in advance,

Tom

tdriscoll is offline   Reply With Quote
Old 05-17-2017, 02:50 AM   #2
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,499
Thanks: 360
Thanked 779 Times in 744 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Opening another form at a specific record, based on current form and record

From your description of what you are doing it is difficult to advise you. It's better if you provide an overall picture of your problem. From the limited information you have given I would point you towards using subforms...
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is online now   Reply With Quote
Old 05-17-2017, 05:38 AM   #3
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,499
Thanks: 360
Thanked 779 Times in 744 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Opening another form at a specific record, based on current form and record

What is a Subform?

Well, it's nothing special, it's just a standard everyday form.

What does Subform mean then?

When you drag and drop a form on to the form you are editing, MS Access automatically embeds the form you are placing in a Subform/subreport control.

What's a Subform/subreport control?

It stores editable information controling how the records of the form and Subform should interact.

Subforms are nothing special, it's this practicality invisible intermediary control, the "Subform Window" which makes an ordinary form a Subform.

Interesting to Note:-
The original form isn't really "in" the "Subform Window", it's actually a copy of the form. This copy is termed "an instance" in programming terms. This leads to some interesting possibilities, for example, you can effectively put the same form on many forms, or many times on the same form. You can open it, and use it as a standalone form.

I created an example called the "Time Management Matrix" Which I can post and blog about if anyone is interested.

Sent from my SM-G925F using Tapatalk

__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is online now   Reply With Quote
The Following User Says Thank You to Uncle Gizmo For This Useful Post:
tdriscoll (05-22-2017)
Old 05-17-2017, 07:06 AM   #4
tdriscoll
Newly Registered User
 
Join Date: Apr 2017
Posts: 5
Thanks: 4
Thanked 0 Times in 0 Posts
tdriscoll is on a distinguished road
Re: Opening another form at a specific record, based on current form and record

Hi Gizmo,

I've attached an image of how I am planning out this database.

Is the idea of a button with variable events in this layout feasible?

I will also look into sub-forms to see if that could be the answer.
Attached Images
File Type: png db_plan.PNG (22.8 KB, 48 views)
tdriscoll is offline   Reply With Quote
Old 05-17-2017, 07:10 AM   #5
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 6,844
Thanks: 92
Thanked 1,686 Times in 1,567 Posts
isladogs is just really nice isladogs is just really nice isladogs is just really nice isladogs is just really nice isladogs is just really nice
Re: Opening another form at a specific record, based on current form and record

Just to say, if you succeed with this project, it could make a useful addition to the sample databases section when complete
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Web links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Previously known as ridders : Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 05-17-2017, 07:53 AM   #6
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,499
Thanks: 360
Thanked 779 Times in 744 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Opening another form at a specific record, based on current form and record

I'm not getting anything from the image you supplied.

What do I mean by that?

Well usually when somebody has a question it's usually about a problem that has been presented on the forum before. Many of us have been here for 10 years or more! So we've seen most things.

Having said that we also have our own little foibles and our own areas of expertise, hence it is possible someone will look at your Image and immediately know what you want. However I don't. In other words it's not saying to me, oh! it's that problem again, and this is the solution.

I would suggest you explain exactly what you are trying to do in layman's terms.

Imagine someone who knew nothing about fire stations decided to build one. They submit a planning application with a garage for the fire engines on one side of the plot and a building to quarter the firefighters on the other side of the plot. Someone who knows about fire stations says, no don't do it like that put the firefighters above the garage and have a big long pole for the firefighters to slide down!

A better approach at getting an answer would be:-
I'm building a fire station and I think the quarters should be here and the garage should be there. What do you think?
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)

Last edited by Uncle Gizmo; 05-17-2017 at 07:56 AM. Reason: format
Uncle Gizmo is online now   Reply With Quote
Old 05-22-2017, 12:58 AM   #7
tdriscoll
Newly Registered User
 
Join Date: Apr 2017
Posts: 5
Thanks: 4
Thanked 0 Times in 0 Posts
tdriscoll is on a distinguished road
Re: Opening another form at a specific record, based on current form and record

Ok, I suppose my question boils down to:

Can a button on a form have different outcomes depending on the record being viewed?

In layman's terms, it might translate as:

I have a list of people, and know what each of their favourite hobbies are. I want to be able to go from the person, to their favourite hobby. How might I do this?

Something like: from one button on the people form, open the hobbies form, at the appropriate record. The difficulty comes in the button linking to a different hobbies record from each people record.


Last edited by tdriscoll; 05-22-2017 at 04:12 AM.
tdriscoll is offline   Reply With Quote
Old 05-22-2017, 01:08 AM   #8
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 9,499
Thanks: 360
Thanked 779 Times in 744 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Re: Opening another form at a specific record, based on current form and record

What are your tables like?

Show field types and some example records for each of your tables

Sent from my SM-G925F using Tapatalk
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is online now   Reply With Quote
Old 05-22-2017, 02:05 AM   #9
static
Newly Registered User
 
Join Date: Nov 2015
Posts: 823
Thanks: 4
Thanked 192 Times in 179 Posts
static will become famous soon enough static will become famous soon enough
Re: Opening another form at a specific record, based on current form and record

Quote:
Originally Posted by tdriscoll View Post
I have a list of people, and know what each of their favourite hobbies are. I want to be able to go from the person, to their favourite hobby. Who might I do this?
I think you've answered your own question. You have lists.

List/combo controls hold data and can perform actions based on the selected value(s).

static is offline   Reply With Quote
Reply

Tags
button , form , parent form , record id , relationship

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening specific form record from datasheet hyperlink for (New) Record ry-mac Forms 1 01-14-2017 01:37 PM
Opening a form "based on multible tables" on a specific record docxyz Forms 2 12-31-2014 12:22 PM
Opening a form for a specific record rickdave Forms 0 11-29-2011 02:11 AM
Open specific report record based on form record values dbaldwin Modules & VBA 5 04-26-2011 08:54 AM
Requery form and goto specific record based on record from different form Ray Spackman Forms 14 07-05-2009 11:57 AM




All times are GMT -8. The time now is 10:36 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World