A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Show additional field in subform when user makes the right selecti



 
 
Thread Tools Display Modes
  #1  
Old February 10th, 2009, 01:30 PM posted to microsoft.public.access.tablesdbdesign
Pete
external usenet poster
 
Posts: 384
Default Show additional field in subform when user makes the right selecti

I have a master/detail form/subform based on tables for Purchase Orders
(master) and their order lines (detail).

I have a table for 'Categories' (around 30) which can be selected for each
PO line (detail).

I am displaying an additional field in the detail section so that users can
assign a vehicle to that PO line when the user selects either 'Vehicle -
Purchase', 'Vehicle - Maint. Repair' or 'Vehicle - Project Repair' from the
'Categories' drop-down for each PO line. I have a master table with vehicle
details.

I could just add an additional field to the detail table (PO order lines),
but that would mean all records with a category other than those above would
have a field for a vehicle ID which would not be relevant, and would be
inefficient.

I presume I need an additional table (for efficiency) to facilitate this but
I am unsure how to incorporate this.

I would think the additional table would hold the PO #, Vehicle reg &
Category ID for either 'Vehicle - Purchase', 'Vehicle - Maint. Repair' or
'Vehicle - Project Repair'.

Any comments would be greatly appreciated.
Many thanks in advance.
  #2  
Old February 10th, 2009, 02:05 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Show additional field in subform when user makes the right selecti

If there's only one or two of these related fields that are
category-dependent, it probably makes sense to just provide them in the
related table. Make them as generic as possible, e.g. you might call the
field Identifier rather than VehicleID, as things in other categories may
have some kind of identifier also.

If there really are several different kinds of fields that are
category-dependent, you might have to create related tables to hold this
additional data. Search on the keyword subclass - that should give you leads
on this idea. (In general, I try to avoid doing this if I can get away with
it, as you really want to keep your structure as simple as possible.)

It is posible to use the Current event of the main form to show/hide a
control in the subform depending on the category. However, toggling the
Visible property will affect all rows in the subform (in
continuous/datasheet view.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Pete" wrote in message
...
I have a master/detail form/subform based on tables for Purchase Orders
(master) and their order lines (detail).

I have a table for 'Categories' (around 30) which can be selected for each
PO line (detail).

I am displaying an additional field in the detail section so that users
can
assign a vehicle to that PO line when the user selects either 'Vehicle -
Purchase', 'Vehicle - Maint. Repair' or 'Vehicle - Project Repair' from
the
'Categories' drop-down for each PO line. I have a master table with
vehicle
details.

I could just add an additional field to the detail table (PO order lines),
but that would mean all records with a category other than those above
would
have a field for a vehicle ID which would not be relevant, and would be
inefficient.

I presume I need an additional table (for efficiency) to facilitate this
but
I am unsure how to incorporate this.

I would think the additional table would hold the PO #, Vehicle reg &
Category ID for either 'Vehicle - Purchase', 'Vehicle - Maint. Repair' or
'Vehicle - Project Repair'.

Any comments would be greatly appreciated.
Many thanks in advance.


  #3  
Old February 10th, 2009, 02:54 PM posted to microsoft.public.access.tablesdbdesign
Pete
external usenet poster
 
Posts: 384
Default Show additional field in subform when user makes the right sel

"Allen Browne" wrote:

If there's only one or two of these related fields that are
category-dependent, it probably makes sense to just provide them in the
related table. Make them as generic as possible, e.g. you might call the
field Identifier rather than VehicleID, as things in other categories may
have some kind of identifier also.

If there really are several different kinds of fields that are
category-dependent, you might have to create related tables to hold this
additional data. Search on the keyword subclass - that should give you leads
on this idea. (In general, I try to avoid doing this if I can get away with
it, as you really want to keep your structure as simple as possible.)

It is posible to use the Current event of the main form to show/hide a
control in the subform depending on the category. However, toggling the
Visible property will affect all rows in the subform (in
continuous/datasheet view.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


Many thanks Allen.

Adding the VehicleID field to the subform table (detail) is certainly the
easiest/convenient option and so I will follow this through.
I did wonder if I could append the PO #, Vehicle ID & CategoryID to an
additional (junction) table and have lookups for the additional fields on the
subform - based on the PO #.

Would this be a possible alternative?
Many thanks.
  #4  
Old February 10th, 2009, 03:07 PM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Show additional field in subform when user makes the right sel

Yes, that's possible.
That's subclassing.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Pete" wrote in message
...
"Allen Browne" wrote:

If there's only one or two of these related fields that are
category-dependent, it probably makes sense to just provide them in the
related table. Make them as generic as possible, e.g. you might call the
field Identifier rather than VehicleID, as things in other categories may
have some kind of identifier also.

If there really are several different kinds of fields that are
category-dependent, you might have to create related tables to hold this
additional data. Search on the keyword subclass - that should give you
leads
on this idea. (In general, I try to avoid doing this if I can get away
with
it, as you really want to keep your structure as simple as possible.)

It is posible to use the Current event of the main form to show/hide a
control in the subform depending on the category. However, toggling the
Visible property will affect all rows in the subform (in
continuous/datasheet view.)

Many thanks Allen.

Adding the VehicleID field to the subform table (detail) is certainly the
easiest/convenient option and so I will follow this through.
I did wonder if I could append the PO #, Vehicle ID & CategoryID to an
additional (junction) table and have lookups for the additional fields on
the
subform - based on the PO #.

Would this be a possible alternative?
Many thanks.


  #5  
Old February 10th, 2009, 03:47 PM posted to microsoft.public.access.tablesdbdesign
Pete
external usenet poster
 
Posts: 384
Default Show additional field in subform when user makes the right sel



"Allen Browne" wrote:

Yes, that's possible.
That's subclassing.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


I can't find any info on "subclass" withing access. Would you kindly point
me in the direction of a relevant article?

Many thanks.
  #6  
Old February 11th, 2009, 05:21 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Show additional field in subform when user makes the right sel

Try a search such as this:
http://groups.google.com/groups/sear...hors=&safe=off

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Pete" wrote in message
...


"Allen Browne" wrote:

Yes, that's possible.
That's subclassing.

I can't find any info on "subclass" withing access. Would you kindly point
me in the direction of a relevant article?

Many thanks.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:59 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.