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

Enabling/Disabling a Checkbox

Status
Not open for further replies.

MChancellor

Technical User
Jan 12, 2000
35
0
0
US
Hi... I'm needing some help. I have a piece of code that used to work, that now no longer functions. From what I can tell, the code should work, but it doesn't. If you all can help me figure out what I'm missing, that would be great.

I helped build a small database for a nonprofit company, but it was an "on the side" thing, and I'm not there all the time. I got a call from my contact there this past week saying that one of their employees had used another employee's user id and password and had messed up a checkbox on one of the forms. No one knows what she did, but it doesn't work now.

I went in yesterday to see if I could solve the problem. I looked at the code, and it was fine. I checked to make sure that the checkbox was enabled on the form, and the properties portion of things looked fine. A similar piece of code worked fine when I tried it.

The checkbox that isn't working is on a subform on a main form. It is tied to a drop down on the subform. Based on what is chosen in the subform, the checkbox is either enabled or disabled. Here's the code that controls this functionality (which used to work fine):

Private Sub Client_Status_AfterUpdate()
If [Client Status].Value = "Dropped" or [Client Status].Value = "Completed" or [Client Status].Value = "No Show" Then
[Referral Source Notified].Enabled = True
Else: [Referral Source Notified].Enabled = False
End If
End Sub

I'm baffled by all this, because from what I can tell, the code is fine, the properties on the check box look to be set properly, and since a similar piece of code works, I can't understand why this one isn't. I have the same piece of code inserted into the Form_Load and Form_GotFocus methods for the same form. None of them work.

If anyone can help me with this, I'd REALLY appreciate it. The only thing I haven't checked is the permissions on the user, but I have the user set up as an admin, so I don't think that would be an issue. Also, we tried it on another users account, and it didn't work on that either.

Any help would be greatly appreciated.
Misti
 
Maybe the .Locked property is set on purpuse so you cannot enable or disable it (wild guess, didn;t have a try).

Cactus
 
Hi Cactus,

I checked that. On the property sheet for that particular object (check box) Enabled is set to Yes and Locked is set to No.
 
When I originally created the database back in Oct/Nov of last year, this functionality worked fine. In fact, it worked great up until last week when this employee changed something. We had limited the functionality to read-write (no admin) on this employee because she isn't familiar with Access and we didn't want her to mess up and change something she shouldn't. It worked great until she found out her coworker's id and password and used those (and subsequently messed this up). (Yes, I know, security issues, but I can't do anything about that - I'm the outsider.) I've tried the following:

Removing the code and reinserting it - didn't work
Removing the subform from the mainform and then putting it back - didn't work
Rebooting the machine (supposedly that worked once) - didn't work
I tried using the converse of the comparison (If it's NOT equal to current or wait-listed, enable it), but that didn't work.

When I was going through it, I did find that the combo box had a different name than what I had in the code, but I fixed that by renaming the combo box, and the code still didn't work. All the other names were correct. (I looked to see if maybe they were mispelled or something, but couldn't see anything there, either.

We did change the password of the user whose id/password were compromised, in an attempt to prevent further damage, but that doesn't change the fact that this isn't working.

What blows my mind about it all is that I've looked for everything that would be an obvious issue, and some of the things that would be more subtle, but I can't find it. I don't know what the deal is, but it's a bit frustrating. I told my contact there that I'd see what I could find out, but that at the present, I had no clue what the problem was.

What I'm not understanding is that the similar functionality (almost the same code - just different fields) on the main form works great, but the one on the subform isn't working (now). I compared the two pieces of code, and they both look fine. I'm kind've at the end of the rope and not sure what to do to fix it. Any suggestions are appreciated. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top