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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|