Query for a button opening a sub-table form (1 Viewer)

Elie00

Registered User
Joined
Jul 8, 2008
Messages
21
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
 

Isskint

Slowly Developing
Joined
Apr 25, 2012
Messages
1,302
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.
 

Minty

AWF VIP
Joined
Jul 26, 2013
Messages
6,543
I would put all three sub-forms on separate tabbed pages Then you only see the tab you have clicked on.
 

Elie00

Registered User
Joined
Jul 8, 2008
Messages
21
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.
 

Isskint

Slowly Developing
Joined
Apr 25, 2012
Messages
1,302
Hi Elie,

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

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
 

Minty

AWF VIP
Joined
Jul 26, 2013
Messages
6,543
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.
 

Elie00

Registered User
Joined
Jul 8, 2008
Messages
21
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?
 

Minty

AWF VIP
Joined
Jul 26, 2013
Messages
6,543
Can you post up a stripped down version of the DB - I have no idea what that could be?
 

Elie00

Registered User
Joined
Jul 8, 2008
Messages
21
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom