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

Meet condition based on check box

Status
Not open for further replies.

infotech2

MIS
Nov 29, 2001
34
US
I have two comboboxes that I control the state of (enabled/disabled) with two check boxes. When I check one of the boxes the combobox relating to that check box gets enabled and allows a user to make a selection.

I put the code in the Click event of the check box. Here is the snippet I'm using:

If Me!cxboxNonConServ Then
Me!cbReason.Enabled = True
Else
Me!cbReason = Me!cbReason.OldValue
Me!cbReason.Enabled = False
End If

The problem arises when I scroll to a new record on my data entry form. The new record inherits whatever state the check boxes and comboboxes were in on the previous record. So if one was checked, it stays checked instead of going back to the default state of unchecked, and the combo box will stay enabled instead of reverting to disabled.

Are there any good work arounds for this? The only thing I've thought of so far is disabling the ability to scroll to the next record and adding a button for entering new records. My idea doesn't seem like a very good one and I'm not sure how to implement it.

Any suggestions?

Thanks for taking the time to read and help with this.
 
Set the default behaviour you want in the Current event procedure of the form.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you for the sift response. Your suggestion worked like a champ.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top