Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-17-2016, 02:50 AM   #1
Elie00
Newly Registered User
 
Join Date: Jul 2008
Location: Beirut
Posts: 21
Thanks: 7
Thanked 0 Times in 0 Posts
Elie00 is on a distinguished road
Query for a button opening a sub-table form

Hey guys,

I want to create a button when pressed would take me to a form showing the details of the sub-table of the entry currently on screen. i'm sure it's a query.

For example:
I have a table called "Jobs" and it has 3 sub-tables linked to it.

I want to create a form from the table "jobs" and in it a button for each sub-form that would show the details linked to the specific entry currently showing on screen in the "Jobs" form.

What is the query to be created, i know that a sub-form is automatically created when i create a form, but since i have three i don't want anyone to show automatically.

Thanks guys

Elie00 is offline   Reply With Quote
Old 05-17-2016, 02:55 AM   #2
Isskint
Slowly Developing
 
Isskint's Avatar
 
Join Date: Apr 2012
Location: Wiltshire, UK
Posts: 1,289
Thanks: 108
Thanked 311 Times in 304 Posts
Isskint will become famous soon enough
Re: Query for a button opening a sub-table form

Hi Elie

I think we may need more information to help.

Can you provide the names of the 3 sub-tables and the relationship(s) PK/FK that link them to the Jobs table. Also a little insight into the purpose of the 3 sub-tables may help. From what you have said so far, i get a feeling your 3 sub tables are for different 'types' of jobs, in which case a single table may suit and that would make your OP simpler.
__________________
Isskint, i get satisfaction out of helping others
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Success is the sum of small efforts, repeated day in and day out
Isskint is offline   Reply With Quote
The Following User Says Thank You to Isskint For This Useful Post:
Elie00 (05-17-2016)
Old 05-17-2016, 02:58 AM   #3
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 5,676
Thanks: 137
Thanked 1,531 Times in 1,503 Posts
Minty has a spectacular aura about Minty has a spectacular aura about Minty has a spectacular aura about
Re: Query for a button opening a sub-table form

I would put all three sub-forms on separate tabbed pages Then you only see the tab you have clicked on.

__________________
If we have helped please add to our reputation - click the scales symbol on the left, tick 'I approve' and leave a comment.

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.
Minty is offline   Reply With Quote
The Following User Says Thank You to Minty For This Useful Post:
Elie00 (05-17-2016)
Old 05-17-2016, 03:15 AM   #4
Elie00
Newly Registered User
 
Join Date: Jul 2008
Location: Beirut
Posts: 21
Thanks: 7
Thanked 0 Times in 0 Posts
Elie00 is on a distinguished road
Re: Query for a button opening a sub-table form

Quote:
Originally Posted by Isskint View Post
Hi Elie

I think we may need more information to help.

Can you provide the names of the 3 sub-tables and the relationship(s) PK/FK that link them to the Jobs table. Also a little insight into the purpose of the 3 sub-tables may help. From what you have said so far, i get a feeling your 3 sub tables are for different 'types' of jobs, in which case a single table may suit and that would make your OP simpler.
Hello Isskint,

the three sub-tables have a one to many relationship with the main table "Jobs"
the first one is called "ex-works", second is called "freight rate" and the third is called "customs formality"

I work in shipping and i need to create a database to help me follow up on my quotations.
I want to add a forth sub-table for the quotations sent to clients.
Elie00 is offline   Reply With Quote
Old 05-17-2016, 03:19 AM   #5
Elie00
Newly Registered User
 
Join Date: Jul 2008
Location: Beirut
Posts: 21
Thanks: 7
Thanked 0 Times in 0 Posts
Elie00 is on a distinguished road
Re: Query for a button opening a sub-table form

Quote:
Originally Posted by Minty View Post
I would put all three sub-forms on separate tabbed pages Then you only see the tab you have clicked on.
i'll try that thx
Elie00 is offline   Reply With Quote
Old 05-17-2016, 03:28 AM   #6
Isskint
Slowly Developing
 
Isskint's Avatar
 
Join Date: Apr 2012
Location: Wiltshire, UK
Posts: 1,289
Thanks: 108
Thanked 311 Times in 304 Posts
Isskint will become famous soon enough
Re: Query for a button opening a sub-table form

Hi Elie,

This all sounds TOO familiar. I am a Supply Chain Manager

I think Minty has the answer for you in terms of display. Create a form for each sub table. Is your current display form a single form or a continuous form? If continuous, create an InDetail form, if single then that form is your InDetail form.

Then add a tab control to your InDetail form. Add 1 sub table form to each tab. As you do this Access will either figure out the Parent/Child fields or prompt you for them. So each tab will only show data from the relevant sub table that matches the entry on the InDetail form.

No command buttons needed in this way.

If you are using a continuous form at the moment, you will need to add an event to open the InDetail form. My preferred method;
1) Set one field (the PK ideally) as Hyperlink:ScreenOnly.
2) In the OnClick event use a macro or VBA to open the InDetail form
__________________
Isskint, i get satisfaction out of helping others
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Success is the sum of small efforts, repeated day in and day out
Isskint is offline   Reply With Quote
The Following User Says Thank You to Isskint For This Useful Post:
Elie00 (05-17-2016)
Old 05-17-2016, 03:45 AM   #7
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 5,676
Thanks: 137
Thanked 1,531 Times in 1,503 Posts
Minty has a spectacular aura about Minty has a spectacular aura about Minty has a spectacular aura about
Re: Query for a button opening a sub-table form

If you have a lot of data you can also, using vba, only load the sub forms on the tabbed pages when they are selected, that can speed up the general response of the form as well.

__________________
If we have helped please add to our reputation - click the scales symbol on the left, tick 'I approve' and leave a comment.

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.
Minty is offline   Reply With Quote
Old 05-19-2016, 04:16 AM   #8
Elie00
Newly Registered User
 
Join Date: Jul 2008
Location: Beirut
Posts: 21
Thanks: 7
Thanked 0 Times in 0 Posts
Elie00 is on a distinguished road
Re: Query for a button opening a sub-table form

i'm having an issue with tabbed forms....

everything works fine when i insert the fields of the first tab, but when i insert the fields on the second tab and test the form, the whole things appears blank, even the main page, as if i'm opening a new form.

Any ideas?
Elie00 is offline   Reply With Quote
Old 05-19-2016, 05:29 AM   #9
Minty
AWF VIP
 
Minty's Avatar
 
Join Date: Jul 2013
Location: UK - Wiltshire
Posts: 5,676
Thanks: 137
Thanked 1,531 Times in 1,503 Posts
Minty has a spectacular aura about Minty has a spectacular aura about Minty has a spectacular aura about
Re: Query for a button opening a sub-table form

Can you post up a stripped down version of the DB - I have no idea what that could be?
__________________
If we have helped please add to our reputation - click the scales symbol on the left, tick 'I approve' and leave a comment.

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.
Minty is offline   Reply With Quote
Old 05-20-2016, 01:08 AM   #10
Elie00
Newly Registered User
 
Join Date: Jul 2008
Location: Beirut
Posts: 21
Thanks: 7
Thanked 0 Times in 0 Posts
Elie00 is on a distinguished road
Re: Query for a button opening a sub-table form

Quote:
Originally Posted by Minty View Post
Can you post up a stripped down version of the DB - I have no idea what that could be?
Thx Minty I was doing it all wrong, it's working now. i created the forms independently and adding them on each tab.

Thanks again.

Elie00 is offline   Reply With Quote
Reply

Tags
button , form , query , sub-form

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening an attachment from a different table using a button on a form jjake Forms 3 01-04-2016 12:05 PM
opening a query in a command button erbrntos Queries 2 09-30-2012 10:05 PM
Opening an attachment from a form button honeyshape Macros 2 05-22-2009 08:18 AM
Several forms with the same button for opening same form fspc Forms 0 11-03-2004 05:20 PM
Forms,opening form view of a query or table to enter related details to customer. Martini Forms 1 12-06-2000 08:04 PM




All times are GMT -8. The time now is 07:30 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