Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check Boxes

Status
Not open for further replies.

BMcMakin

Programmer
Oct 21, 2003
16
US

How do I use a bound checkbox to set the value in a control on a form when the checkbox and the control I want to change is in a subform and the value I want is in a bound textbox in the parent form?

Also, if the box is unchecked, how do I change the value back to null?
 
in the after update event of your checkbox you need code similar to this
chkBox = your checkbox (This must be bound to work correctly on a subform)
txtParent = your text box on parent form
txtChild = the text box you want to set the value for

'if a chkBox is checked then its value will be true so set your child text box = to the parent

If chkBox.Value = True Then


txtChild.Value = txtParent.Value 'NB if your child txtbox is in a subform then use Me.Parent!txtParent.Value

Else

'if chkBox value isnt true then you want to clear txtChild's value to null

txtChild.Value = Null

End If
 
I don't want to sound like an idiot...but I can't get this to work.

I want to insert a value into the the "Release#" field in the "Release_Equipment" table.

My Parent form is based on a seperate Table ("Release_Define") that also has a "Release#" field.

The subform's control source is the "Release_Equipment" table mentioned above. This table also has Yes/No Field called (Fill_Release).

The subform is a continuous form so that all of the items can be displayed. I want the user to check the checkbox bound to "Fill_Release" if they want it associated with the particular release#. But I can't get that action of checking the checkbox to fill in the value for Release# that is in the parent form.

Please help.
 
How are ya BMcMakin . . . . .

If the [blue]ParentForm[/blue] is The [blue]MainForm[/blue]:

[blue]Me!SubFormTextBoxName = Forms!MainFormName!textBoxName[/blue]

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top