Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Join Date
    Sep 2003
    Location
    Washington, DC
    Posts
    116

    Angry Enable if check box = true - WON'T WORK

    Can anyone help with this? I'm trying to enable a field if the value of a check box is true.

    Private Sub ECash_AfterUpdate()
    If ECash = True Then Me.ECashAmt.Enable = True Else Me.ECashAmt.Enable = False
    End If
    End Sub

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by PatrickFAO
    Can anyone help with this? I'm trying to enable a field if the value of a check box is true.

    Private Sub ECash_AfterUpdate()
    If ECash = True Then Me.ECashAmt.Enable = True Else Me.ECashAmt.Enable = False
    End If
    End Sub
    What are the controls in question?

    Try:

    EcashAmt.Enabled=false
    If ECash.Value=True then EcashAmt.Enabled=True
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    Quote Originally Posted by PatrickFAO
    Can anyone help with this? I'm trying to enable a field if the value of a check box is true.

    Private Sub ECash_AfterUpdate()
    If ECash = True Then Me.ECashAmt.Enable = True Else Me.ECashAmt.Enable = False
    End If
    End Sub
    Try this:

    Code:
    ECashAmt.Enabled = False 'Put this on the form load procedure
    
    IF ECash.Value = True Then
    
      Me.ECashAmt.Enabled = True
    
    Else
    
      Me.ECashAmt.Enabled = False
    
    End If
    Last edited by cruickshanks; 10-22-04 at 09:44.

  4. #4
    Join Date
    Sep 2003
    Location
    Washington, DC
    Posts
    116
    I get a compile error: method or data member not found.

  5. #5
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    ok, what version of access are you using?

  6. #6
    Join Date
    Sep 2003
    Location
    Washington, DC
    Posts
    116
    Version 2K3

  7. #7
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    Quote Originally Posted by PatrickFAO
    Version 2K3
    Ok. Seeing as im at work, i only have access 97 on my machine here.

    I have created a database that does the operation that you are trying to do.

    Hopefully that'll help, because i was going to ask you to send me a copy of your database so i could take a look and see if i could get it going for you.
    Attached Files Attached Files

  8. #8
    Join Date
    Sep 2003
    Location
    Washington, DC
    Posts
    116
    i got a bunch of fatal errors on the db. here's mine.

  9. #9
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    It won't work with Access 97 im afraid.

    Which control did you put the code onto? ECash or ECashAmt?

  10. #10
    Join Date
    Sep 2003
    Location
    Washington, DC
    Posts
    116
    sorry here it is
    Attached Files Attached Files

  11. #11
    Join Date
    Sep 2004
    Location
    Reston, VA
    Posts
    86
    Put this code in the ECash checkbox's Click event, instead of the After_Update:

    ECashAmt.Enabled = ECash

    That should do what you want.

  12. #12
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    it doesn't work with access 97. The code it told you before, did you put it on the ECash control or the ECashAmt control?

    I put it on the ECash control and it worked.

  13. #13
    Join Date
    Sep 2003
    Location
    Washington, DC
    Posts
    116
    My VB has a C++ runtime error and can't get into the code now.

  14. #14
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    not good. try restarting your pc and pray it works again.

  15. #15
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    998
    Quote Originally Posted by BummerJeff
    Put this code in the ECash checkbox's Click event, instead of the After_Update:

    ECashAmt.Enabled = ECash

    That should do what you want.
    BummerJeff is correct,

    Set the property for your TextField to Enabled=No
    ECash being your CheckBox and ECashAmt being your CheckBox.

    niters all
    Bud

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •