RexesOperator
Registered User.
- Local time
- Today, 03:44
- Joined
- Jul 15, 2006
- Messages
- 604
This is probably another easy fix (I hope).
I want to be able to clear fields on a subform using a command button on the main form. The combobox (cboTransactionID) is on a subform control(ctlTrnxsSub ). I used a different name for the control and the subform so I know which is which). The main form is frmTransactions and the subform is frmTrxnsDetailsSub.
Using the various examples (including this site -http://www.mvps.org/access/forms/frm0031.htm), and after reading Bob Larson's explantion I have the following on a command button:
Private Sub cmdClearAllFields_Click()
Me.cboCompanyID.Value = Null
Me.lbxContactID.Value = Null
Me.txtFIRSTNAME.Value = Null
Me.txtLASTNAME.Value = Null
Me.ctlTrxnsSub.Form.cboTransactionID.Value = Null
End Sub
The first four fields are on the main form and behave the way I expect them to. The last one is on the sub form and give the "Apllication-defined or object-defined error".
I want to be able to clear fields on a subform using a command button on the main form. The combobox (cboTransactionID) is on a subform control(ctlTrnxsSub ). I used a different name for the control and the subform so I know which is which). The main form is frmTransactions and the subform is frmTrxnsDetailsSub.
Using the various examples (including this site -http://www.mvps.org/access/forms/frm0031.htm), and after reading Bob Larson's explantion I have the following on a command button:
Private Sub cmdClearAllFields_Click()
Me.cboCompanyID.Value = Null
Me.lbxContactID.Value = Null
Me.txtFIRSTNAME.Value = Null
Me.txtLASTNAME.Value = Null
Me.ctlTrxnsSub.Form.cboTransactionID.Value = Null
End Sub
The first four fields are on the main form and behave the way I expect them to. The last one is on the sub form and give the "Apllication-defined or object-defined error".