Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2005
    Posts
    21

    Exclamation Unanswered: Lock or Hide Fields

    I am using the following code as part of a command button to lock or "grey out" a field when it is an inactive person on a form.

    Me.Writer.Enabled = Not Me.Writer.Enabled

    But it does it for all of the records on the form. How can I get it to work on a single record?


    Jacque

  2. #2
    Join Date
    Sep 2005
    Posts
    21

    Filter?

    In looking around it seems as if a filter would be what I am looking for.

    Does that sound right?

  3. #3
    Join Date
    Oct 2005
    Posts
    178
    Quote Originally Posted by davenportjacque
    I am using the following code as part of a command button to lock or "grey out" a field when it is an inactive person on a form.

    Me.Writer.Enabled = Not Me.Writer.Enabled

    But it does it for all of the records on the form. How can I get it to work on a single record?


    Jacque
    is "Writer" a field text object or a form object?

  4. #4
    Join Date
    Sep 2005
    Posts
    21
    "Writer" is the name of the text box on the form.

  5. #5
    Join Date
    Oct 2005
    Posts
    178
    if you change the property of "Writer" manually does it response correctly?

  6. #6
    Join Date
    Sep 2005
    Posts
    21
    Oh yes, I can change the individual records manually ok (like add or change).

    But what I am looking for is a check box or command button or *something* that a user can click (or whatever) that will disable, hide or otherwise make it pretty dang evident that that individual person/record is inactive.

  7. #7
    Join Date
    Nov 2004
    Posts
    64
    prehaps something like this

    If Me.field1 < 2 Then
    Me.field2.BackColor = 0
    Else
    Me.field2.BackColor = 255
    End If

    cheers


    Peter

  8. #8
    Join Date
    Sep 2005
    Posts
    21
    That kind of confused me Peter, I only have one field.

    Should I add another?

  9. #9
    Join Date
    Dec 2005
    Location
    Texas
    Posts
    13
    Hey Davenport,

    Is this on a continuous form? It sounds like it is. If so, then you can do as you stated below.


    Quote Originally Posted by davenportjacque
    Oh yes, I can change the individual records manually ok (like add or change).

    But what I am looking for is a check box or command button or *something* that a user can click (or whatever) that will disable, hide or otherwise make it pretty dang evident that that individual person/record is inactive.
    You will need to add a check box to your table so that it will be bound (I think it has to be bound). Go to Format>Conditional formatting change the condition 1 to Expression Is then to the right of it put in [CheckBoxName]=True, then in your preview of format to use, the last choice to the right is enable/disable, choose what you want to do.

    Hope I followed what your wanted to do alright.

    HTH,
    Shane

  10. #10
    Join Date
    Sep 2005
    Posts
    21
    Hmm, that sounds intriguing. I'll give it a shot on Thursday (which is my Monday. Not to be confused with Monday, which is my Friday (today).

    Actually I just tried it. It changes all the records, rather than just the one it is next to. Though I did not make the checkbox bound to the table. Would that make a difference?

    Oh, and yes, it is a continuous form.
    Last edited by davenportjacque; 12-13-05 at 02:50.

  11. #11
    Join Date
    Dec 2005
    Location
    Texas
    Posts
    13
    Hey Davenport,

    I thought it might make a difference, that's why in my first post I said you need to make the check box a bound control (I think). Well now that you've let me know it changed all of them then I can say, yes it needs to be bound. I know this works cause I just did the same thing yesterday on one of my forms.

    Hope you get it working,
    Shane

Posting Permissions

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