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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check box Enabling Text box

Status
Not open for further replies.

ValF47

MIS
Jan 24, 2007
13
US
Hello. I am having a similar issue as in thread 702-651866. I have a small, not complex database in Access 2003 created to store hardware and software inventory. It contains 3 tables and 3 forms. On the software form, I have a check box to be select if the software item has the ability to be renewed. When the check box is select I want to have a text box enable prompting for a renewal date. Right now when i check the box, the text box does enable. However, when I move on to the next record, it stays as it did previously. My code is below for both on click and afterupdate events. Please let me know what I need to add to have the checkbox answer be reflected differently for each record. Thank you very much.

Private Sub Renew_AfterUpdate()
If Renew.Value = vbChecked Then
RenewalDate.Enabled = True
Else
RenewalDate.Enabled = False
End If
End Sub

Private Sub Renew_Click()
If Renew.Value = vbChecked Then
RenewalDate.Enabled = True
Else
RenewalDate.Enabled = False
End If
End Sub
 
In the Current event procedure of the form:
Me!RenewalDate.Enabled = (Me!Renew.Value = vbChecked)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you for your suggestion, however it did not work. The checkbox is still reacting the same way. After I check the box for one entry, move on to the next, the check box stays checked but the text box is disabled. This is also true if I exit the Db and go back in to add more entries. The prior entries all have a disabled text box. Weird.
 
I think PHV got a little quick in his reply, it probably should have been:

In the Current event procedure of the form:
Me!RenewalDate.Enabled = Me!Renew

PaulF
 
That did it!! Thank you both for the assistance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top