Change caption - Datasheet Subform

G

Guest

Hi all,
I am looking to create a dynamic subform, that when the main form is loaded,
the captions and fields of the subform will adjust, based on a field
(Order_Product_ID) in the table (Orders) that controls the main form. The
subform is contolled by another table (Items), which links to the Orders
table and main form through the field Order_ID.
Based on which Order_Product_ID is loaded into the main form, I would like
the captions and fields to change. For example, if the Order_Product_ID is
1, I would like Caption1 to be "Step1" and would link to the field Step1 in
the Items table. If Order_Product_ID is 2, then Caption1 would read "Step5"
and link to the field Step5 in the Items table. There would then be many
other options put in as well.
I have tried using the onLoad event for the subform, based on a lookup of
the Order_Product_ID, but have not yet gotten it to work.
Any thoughts on this? Help is appreciated, thanks!
-gary
 
K

kingston via AccessMonster.com

Have you considered just copying the subform 5 times, making the changes, and
then changing the subform control's Source Object? In essence, the subform
would be changed based on the Order_ID. You could also use a tab control
with 5 tabs (and subforms) - one for each step.
 
G

Guest

Hi,
Thanks for the advice. Unfortunately, it would not quite work as I would
end up needing to create about a hundred subforms as there are many items
that all go through separate steps. Is there any hope for me? ;)
Thanks again
-gary
 
K

kingston via AccessMonster.com

OK, back to your original question. If you really want to do it this way, I
suggest that you use the main form's OnCurrent event to check
Order_Product_ID and then make appropriate adjustments to the subform.

Gary said:
Hi,
Thanks for the advice. Unfortunately, it would not quite work as I would
end up needing to create about a hundred subforms as there are many items
that all go through separate steps. Is there any hope for me? ;)
Thanks again
-gary
Have you considered just copying the subform 5 times, making the changes, and
then changing the subform control's Source Object? In essence, the subform
[quoted text clipped - 17 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top