Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Conditional Formate

Discussion in 'Information Technology' started by Chey, Jul 28, 2006.

  1. Chey

    Chey
    Expand Collapse
    Guest

    I want to run a macro, that when you click on that field in that form then
    the field fild will turn red and the text white.
    Can some one help me.
    Thanks
    Chey
     
  2. Loading...

    Similar Threads Forum Date
    Inspirational Unconditional love for the Guru Videos Sep 4, 2010
    General Unconditional Love Hard Talk Jun 28, 2008
    Pure and Unconditional Love for God Gurmat Vichaar Feb 18, 2008

  3. Al Camp

    Al Camp
    Expand Collapse
    Guest

    Chey,
    I'd suggest the OnEnter event. That would work with tabbing into the field, or
    clicking it.
    YourTextField.Forecolor = QBColor(15)
    YourTextField.BackColor = QBColr(4)
    Use the OnExit event to return the colors to their normal value.

    --
    hth
    Al Camp
    Candia Computer Consulting - Candia NH
    http://home.comcast.net/~cccsolutions

    "Chey" <Chey@discussions.microsoft.com> wrote in message
    news:6A8D6D45-C761-4B65-8F5A-60BE9D77D2A7@microsoft.com...
    >I want to run a macro, that when you click on that field in that form then
    > the field fild will turn red and the text white.
    > Can some one help me.
    > Thanks
    > Chey
     
  4. Chey

    Chey
    Expand Collapse
    Guest

    Okay that didn't work for me. What I am going for is when I click on it it
    changes color and stays that way.
    How about one click, text turns red
    double click turns black.
    I am showing that I have reconciled that amount. When I used the code below
    it worked but turned every record to that. I just want that one field in the
    record.
    Thanks

    "Al Camp" wrote:

    > Chey,
    > I'd suggest the OnEnter event. That would work with tabbing into the field, or
    > clicking it.
    > YourTextField.Forecolor = QBColor(15)
    > YourTextField.BackColor = QBColr(4)
    > Use the OnExit event to return the colors to their normal value.
    >
    > --
    > hth
    > Al Camp
    > Candia Computer Consulting - Candia NH
    > http://home.comcast.net/~cccsolutions
    >
    > "Chey" <Chey@discussions.microsoft.com> wrote in message
    > news:6A8D6D45-C761-4B65-8F5A-60BE9D77D2A7@microsoft.com...
    > >I want to run a macro, that when you click on that field in that form then
    > > the field fild will turn red and the text white.
    > > Can some one help me.
    > > Thanks
    > > Chey

    >
    >
    >
     
  5. bobocat

    bobocat
    Expand Collapse
    Guest

    Hi Chey,

    I tried to make 2 macros:

    1. Name clickMacro on Event Click
    Action: SetValue
    Item: [Forms]![FormName]![FieldName].[ForeColor]
    Expression: 255

    2. Name: DblClickMacro on Event Double Click
    Action: SetValue
    Item: [Forms]![FormName]![FieldName].[ForeColor]
    Expression: 0

    If you want to restore the color after you leave the field
    3 Name: restoreMacro on Event Lost Focus
    Action: SetValue
    Item: [Forms]![FormName]![FieldName].[ForeColor]
    Expression: 16711680 (say blue color)

    is that OK?


    "Chey" <Chey@discussions.microsoft.com> ¼¶¼g©ó¶l¥ó·s»D:6A8D6D45-C761-4B65-8F5A-60BE9D77D2A7@microsoft.com...
    >I want to run a macro, that when you click on that field in that form then
    > the field fild will turn red and the text white.
    > Can some one help me.
    > Thanks
    > Chey
     
  6. Al Camp

    Al Camp
    Expand Collapse
    Guest

    Chey,
    You won't be doing that with a Click or DblClick.
    Changing the color of a field with a Click would change the color of that field for all
    records during that session. When the form is reopened later, that field revert to the
    color designated in Design mode. Also, during a session, that field will have the same
    color on all records.

    We need a field that will store the "status" of that text control, so we can
    "logically" color the field accordingly... on the fly for each record.

    Add a field to your table called Reconciled, make it a Yes/No (format = True/False)
    field. This will be a checkbox on the form. (ex. name chkReconciled)
    When a record has been reconciled, click the Reconciled checkbox. That in itself
    should be enough for the user to see that this record has been reconciled. but if you
    still need to change the color of a field accordingly, use this code on the AfterUpdate
    event of chkReconciled...
    (use your own control names)

    Private Sub chkReconciled_AfterUpdate()
    If chkReconciled = True Then
    YourFieldName.Forecolor = QBColor(12) 'Light Red
    Else
    YourFieldNAme.Forecolor = QBColor(0) 'Black
    End If
    End Sub

    Also, we'll have to decide on the appropriate color each time we come to a record
    (browse).
    Place the same code as above in the Current event of the form itself.

    When you check Reconciled, the color will change to Red, when you uncheck Reconciled it
    will return to Black (toggling)
    Access can not "remember" if a text control has been clicked or not, so that Reconciled
    "status"


    --
    hth
    Al Camp
    Candia Computer Consulting - Candia NH
    http://home.comcast.net/~cccsolutions

    "Chey" <Chey@discussions.microsoft.com> wrote in message
    news:C5E29962-C3CD-43BC-BC69-D0F2D3B8EE0D@microsoft.com...
    > Okay that didn't work for me. What I am going for is when I click on it it
    > changes color and stays that way.
    > How about one click, text turns red
    > double click turns black.
    > I am showing that I have reconciled that amount. When I used the code below
    > it worked but turned every record to that. I just want that one field in the
    > record.
    > Thanks
    >
    > "Al Camp" wrote:
    >
    >> Chey,
    >> I'd suggest the OnEnter event. That would work with tabbing into the field, or
    >> clicking it.
    >> YourTextField.Forecolor = QBColor(15)
    >> YourTextField.BackColor = QBColr(4)
    >> Use the OnExit event to return the colors to their normal value.
    >>
    >> --
    >> hth
    >> Al Camp
    >> Candia Computer Consulting - Candia NH
    >> http://home.comcast.net/~cccsolutions
    >>
    >> "Chey" <Chey@discussions.microsoft.com> wrote in message
    >> news:6A8D6D45-C761-4B65-8F5A-60BE9D77D2A7@microsoft.com...
    >> >I want to run a macro, that when you click on that field in that form then
    >> > the field fild will turn red and the text white.
    >> > Can some one help me.
    >> > Thanks
    >> > Chey

    >>
    >>
    >>
     

Share This Page