Results 1 to 7 of 7
  1. #1
    Lounger
    Join Date
    Oct 2001
    Location
    New York
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Enabling/Disabling Fields (Access 2000 SP3)

    I have just converted one of my databases from 97 to 2000 and one of the fields is not working. I have a checkbox that when the box is checked for a particular record, all the fields gray out for that record. It worked find in 97, but now in 2000, after the conversion, all the records are grayed out when the checkbox is checked.

    The code I have in there is
    Private Sub Closed_AfterUpdate()
    If Me!Closed = -1 Then
    Me!PlaintiffName.Enabled = False
    Me!IndexNo.Enabled = False
    Me!CaseCaption.Enabled = False
    Me!TrialDate.Enabled = False
    Else
    Me!PlaintiffName.Enabled = True
    Me!IndexNo.Enabled = True
    Me!CaseCaption.Enabled = True
    Me!TrialDate.Enabled = True
    End If

    I also have this code in the On Current

    Any ideas as to why it's no longer working?

    Thanks
    Nadia

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Enabling/Disabling Fields (Access 2000 SP3)

    Is this a continuous form?

  3. #3
    Lounger
    Join Date
    Oct 2001
    Location
    New York
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Enabling/Disabling Fields (Access 2000 SP3)

    Hans, it is a Single Form.

    Thanks
    Nadia

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Enabling/Disabling Fields (Access 2000 SP3)

    What then do you mean by "all the records are grayed out when the checkbox is checked"?

  5. #5
    Lounger
    Join Date
    Oct 2001
    Location
    New York
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Enabling/Disabling Fields (Access 2000 SP3)

    Currently, there are 25 records in this database. When viewing the form, there is a checkbox that is labled "File Closed". If that is check marked, then all the fields for that one particular record should gray out. If you go to the next record, it is enabled and changes can be made. However, now when I check the box all twenty five records gray out.

    Maybe I'm not understanding what a continuous form is...

    Thanks
    Nadia

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Enabling/Disabling Fields (Access 2000 SP3)

    That would imply that Closed_AfterUpdate works OK, but Form_Current doesn't.

    First, check that the On Current event of the form is still "connected" to the code. Open the form in design view; activate the Event tab of the Properties window, and click in the On Current event. It should read [Event Procedure]. Click the builder button (the three dots to the right), and verify that it takes you to the correct code. Switch back to Access, close and save the form, then open it in form view. Does it work correctly now?

    If not, switch to the Form_Current procedure in the Visual Basic Editor again (without closing the form), and click in the left margin to the left of Sub Form_Current(). This will set a breakpoint. You can also click in this line and press F9 to set a breakpoint. Switch back to the form and move to another record. Code execution should pause at the beginning of Form_Current. You can hover the mouse over items to see their value, and you can single step through the code by pressing F8. Can you find out this way what happens? Is the code ignored, or does it use an incorrect value, or ...?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Enabling/Disabling Fields (Access 2000 SP3)

    In a single form, you view only one record at a time. In a continuous form, you can see several records at the same time.

Posting Permissions

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