Update a subform value from check box on main form

D

Del

Hello,

I have an Access 2000 database which has a Main Form and a Subform.
There is a Text Box on the subform that's value I would like to set to
"1" when a Check Box on the main form is checked (-1) and set to "0"
when the check box is unchecked.

Thank's any suggestions.

Del
 
S

Scott McDaniel

Try This:

If Me.YourCheckBox = -1 Then
Me.YourSubFormCONTROL.Form.YourTextBox = 1
Else
Me.YourSubFormControl.Form.YourTextbox = 0
End If

Make sure to reference the control that houses your subform ... it's not
always the same name as the subform itself
 
B

Blaire Comrie

You can point the Default value property on the CheckBox on the Subform to
the CheckBox on the main form.
 
D

Del

Scott,

Thanks for the advise. This work as you said but I forgot to include
one fact. The subform is a Continuous form. And I only want to update
a specific line.
The main form displays Customer Order Header detail, and the subform
displays Customer Order line details. The line detail include colmuns
"Line Number", "Part Number", "order Qty", "Picked Qty" etc. We have a
specific line number (8888) for Shipping and Handling charges and this
line is added as the last line in every order. In some cases (when
shipping to our own branch offices) we do not charge S&H. What I want
to do is if the person reviewing the order check a box in the Main
Form called "Include S&H on Invoice" it will set the "Order Qty" and
"Picked Qty" on the S&H line to a qty of one so the S&H will be added
to the Order Total at the bottom of the form. And if the check boz is
unchecked then the "Order Qty" and "Picked Qty" are set to 0

Sorry for leaving out so much detail.
 

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