RexesOperator
Registered User.
- Local time
- Today, 09:53
- Joined
- Jul 15, 2006
- Messages
- 604
I am using Access 2003.
I have a command button on a sub form that I want to use to change the value of a text box.
The main form is frmAddCompanies.
The sub form is frmAddCompaniesSub.
The command button I am using is cmdADDNewContactMailing.
The text box I want to change is txtMAILINGSAMEASCOMPANY. The data type is text. The default value is Y. I want the value to change to N when the command button is clicked.
I know the form and control references are correct because I use them in the same procedure to enable and disable other text boxes. I have also tried no quotes and single quotes.
This dosen't work, but I don't know why.
Private Sub cmdADDNewContactMailingAddress_Click()
If Forms!frmAddCompanies.frmAddCompaniesSub.Form.txtMAILINGSAMEASCOMPANY.Value = "Y" Then
Forms!frmAddCompanies.frmAddCompaniesSub.Form.txtMAILINGASAMEASCOMPANY.Value = "N"
Else
Forms!frmAddCompanies.frmAddCompaniesSub.Form.txtMAILINGASAMEASCOMPANY.Value = "Y"
End If
End Sub
I have a command button on a sub form that I want to use to change the value of a text box.
The main form is frmAddCompanies.
The sub form is frmAddCompaniesSub.
The command button I am using is cmdADDNewContactMailing.
The text box I want to change is txtMAILINGSAMEASCOMPANY. The data type is text. The default value is Y. I want the value to change to N when the command button is clicked.
I know the form and control references are correct because I use them in the same procedure to enable and disable other text boxes. I have also tried no quotes and single quotes.
This dosen't work, but I don't know why.
Private Sub cmdADDNewContactMailingAddress_Click()
If Forms!frmAddCompanies.frmAddCompaniesSub.Form.txtMAILINGSAMEASCOMPANY.Value = "Y" Then
Forms!frmAddCompanies.frmAddCompaniesSub.Form.txtMAILINGASAMEASCOMPANY.Value = "N"
Else
Forms!frmAddCompanies.frmAddCompaniesSub.Form.txtMAILINGASAMEASCOMPANY.Value = "Y"
End If
End Sub