posted yesterday to no avail

A

aheath15

I have a few quick questions.

1)on a products list, some products contain sub assemblies. This table is
used by a user constructing an order with boolean fields to select products.
If products B and C are sub-components of product A, is there any way to have
B and C automatically selected if A is selected? If you have idea for coding,
please let me know exact terms/exactly where i would put it/ and how to call
any necessary terms

2)Along the same lines, if product C is a necessary component of A, but not
on a sub data sheet, is there any way to automatically select C when A is
selected? In other words, on a list of products, some go hand in hand. I
need to make sure that if one is checked, another one is as well. How can i
do this? again, i am programming illiterate, so please be explicit!

3)one last question....is there any way to hide sub data sheets for products
that do not contain sub assemblies? or at least hide the "+" next to the
product, to make it clear that there are not any further components?

help on any of these issues would be hugely appreciated!!
 
R

Ron2006

Question 1

in the afterupdate for product A (if they are check boxes)

me.productB = me.productA
me.productC = me.productA

If A in turned on then B and C will be also and vise versa.

Question 2
It seems as if this is a repeat of question 1. If it is not then I need
more information to distinguish they two conditions.

Question 3
I don't believe so in the way that these forms are being shown. I looks
as if you have a datasheet view and a subform on that. The + says there
is a subform (with or without data)

Ron
 
A

aheath15

Thanks for your help! the difference with my second question is that product
C is no longer a sub - component of product A. They are on the same table.
My guess is what you said will still work for this. My only question is
WHERE to put in this code? and how will it be executed? from a macro?
 
R

Ron2006

You would put this code on the form in the afterupdate event for field
product A (if they are check boxes)

Right click on the field ProductA
Go to Properties
Go to event
Go to Afterupdate
click on the (....) on the right hand side
if it comes up select "code Builder"

add the following code (this assumes that the field names are productA
productB and productC. (the field name is under the Other tab of the
properties for the field)

me.productB = me.productA
me.productC = me.productA

The above would work for question 1.

However, from the information so far I cannot see how you can
distinguish situation 1 form situation 2 when you are clicking product
A.

You can also go the other way for product C so that if you pick product
C it can make product A checked. But then you would have to go back and
revisit A if this were not the situation.

No macro is necessary, The after update event will be triggered
whenever you change the value in A.
 
A

aheath15

thank you so much for your help.....the last part that i'm not getting:

when you say right click on the field, are you talking about a
table/query/form?
 

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