Changing the tab color of subform pages

mkleino

Registered User.
Local time
Today, 18:06
Joined
Jan 11, 2002
Messages
19
In my database there is a field for notes which is stored in its own table, called "Notes." This table is accessed from a subform, accessed from a tab, which lists all notes for a particular person. Not everyone has notes, however, and there's no way of knowing whether someone has them without clicking the tab. Since some of the notes are pertinent, I was hoping there was a way to notify the user of the presence of notes; specifically, I'd like to have the text on the tab be red or have some other indicator on it that a specific record does have notes. I realize this may not be an easy request, but I'd greatly appreciate any light that could be shed on the subject.
 
I assume that you could (in theory) set an image to the notes tab as you can in design mode by using code in the On_Current event. I have not tried this myself so any helpers.....
 
Well, thanks to both of you. I did, after almost a day's fiddling, get the red tabs to work (nowhere does it mention that for it to work the TabCtl tab width and height settings must be fixed, and can't be 0", which was a very difficult discovery to make). However, due to the limitations I described above, I wasn't all that happy with the results and have decided to use a text box to inform people of notes. I tried the code from the reply but it seems to have horrible syntax or something, because even after modifying it to fit my key names it didn't work...could anyone help me out? I'm actually hoping to put code in the On Current event of the form so that the text box will not be visible unless there is a note avaibable. I'd be thankful for any help.

[This message has been edited by mkleino (edited 01-24-2002).]
 
On the On_Current() event (of the main form)

If Forms![NameofMainForm]![NameofSubform].Form![NameOfNotesField] <>"" Then 'ie not blank

Me.IndicateNotesTextbox.Visible = True
Else: Me.IndicateNotesTextbox.Visible = False
End If

You could have a static message in the Textbox or set its value via code. Make sure it is unbound and has Enabled=No, Locked=Yes to avoid anyone changing its contents.
HTH
 
Thanks Fizzio. I did have to edit the code, using Access Help as guide, so it would work with the tab. This is a generic version what I came up with:

If Me!NameOfTabControl.Pages("NameOfTab").Controls![NameofSubForm]![NameOfNotesField] <> "" Then
Me.IndicateNotesTextbox.Visible = True
Else: Me.IndicateNotesTextbox.Visible = False
End If
Thanks again to everyone!
 

Users who are viewing this thread

Back
Top Bottom