Results 1 to 5 of 5

Thread: Change in entry

  1. #1
    Lois
    Guest

    Change in entry

    Hi,

    I hope I can explain this correctly. I have a page on a form. Included as one of the pages is a place to put "special Billing instructions".

    My question is? Is there some way that I can have the tab at the top of the page change color (or something) when information is put into the "Special Billing Instructions" fields?

    Thanks

    Lois

  2. #2
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Winnipeg, Canada
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change in entry

    Hi Lois,

    I can't find anything in the tabbed control that allows you to change the background color.

    What sometimes is being done (in text editors etc) is to change the caption property by placing a * or ! in front of the caption.

    Code to accomplish this might look something like this (assuming you have a textbox on the page):

    Private Sub Text3_AfterUpdate()
    Dim myVar As String
    myVar = TabCtl0.Pages("Page1").Caption
    TabCtl0.Pages("Page1").Caption = "!" & myVar
    End Sub

    You could enhance this by testing the content of the textbox and adding or removing the character from the caption property.

    This may give you some ideas to try.

  3. #3
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    London, Ontario, Canada
    Posts
    437
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change in entry

    Another option is to use a Graphic on the Tab. I've done this in the past and it can be quite effective. I insert the following code in the On Current Event of the Form..
    <hr>Private Sub Form_Current()
    If (Me.SpecialBillingInstructions = True) Then
    Forms!frmMyForm!Page2.Picture = "c:MyDirectoryGetsAttention.bmp"
    Else
    Forms!frmMyForm!Page2.Picture = ""
    End If
    End Sub<hr>

  4. #4
    Lois
    Guest

    Re: Change in entry

    Ken, thanks for the response.

    A little more help, please, when you refer to TabCtl0, what is that? I know little or nothing about VB and am astounded I understand what little I do. I keep trying tho.

    Lois

  5. #5
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Winnipeg, Canada
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change in entry

    Hi Lois,

    When I was testing my theory for a reply to your post and to create the bit of code included, I quickly threw together a form with a Tab control and on top of that a Textbox control.

    VBA named the Tab control TabCtl0 as its unique name and it named the textbox control Text3, so you can refer to it by name.

    Usually, you would change the assigned names to something a little more meaningful than Text1, Text2, Text3 etc. The generally accepted naming convention would look more like, (as an example): txtCarID, txtVendorName and txtTotalWeight.

    I just didn't bother to rename the controls in my bit of test code.
    Hope that clears up the mystery.

    PS Brian's idea looks like a good suggestion as well. You could have two bitmaps, let's say one with a yellow background and another with red (with the same description on them) and then load the one or the other, depending on the contents of the control(s) you are editing. I must try that some day.

Posting Permissions

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