flag notes on tab

G

Guest

Hi,

I have a form frm_docinput and frm_docedit that contain the same 3 tabs.

On my 2nd and 3rd tabs, these are for notes. 2nd tab is for internal notes
and 3rd tab is for client notes (seen by the client).

On the 2nd tab (name intn) I have 4 fields with the names docn, adn, supn
and othn.

I would like to build a code that when the form loads, if there is anything
entered in the docn, adn, supn and/or othn fileds, that the tab intn is in a
color (lets say Blue) as to flag to say that there are notes to look at.

Is this possible?
 
D

Damon Heron

Without creating your own tab controls, I don't believe you can change the
font color on a tab. How about this instead? make the tab invisible if
there is nothing to see.
If all of your fields are empty, then in the on current event of the form,
put code like this:

Private Sub Form_Current() ' use your own field names - mine are AmtPaid,
AmtDue, and Datedue
If Me.AmtPaid = 0 and Me.AmtDue= 0 and Me.Datedue= 0 Then
Me.Page3.Visible = False
Else
Me.Page3.Visible = True
End If
End Sub

you may also have to account for null values, if that is a possibility.
(like If isnull(Me.AmtPaid) or Me.AmtPaid=0....)

Damon
 
G

Guest

Hi Damon,

I like your idea and I will keep that in mind for future possible needs,
however in this case I believe the tab needs to show as we need to be able to
access the tab to add notes to it. So its really a question of flagging the
user and letting know that there are notes to look at.

So I'm wondering if maybe on the on current form add a similar code as yours
but that if all are 0....a message box comes up saying..."No Messages to Look
At".......but also do another if statement, that if there is a value in
either of the fields, then "There are notes to view" or something like that.

Is that doable? I would really have liked making the tab change color or
at least have the font be bolder if there was notes as its an easy flag, but
if a message box can do the trick, then that would be helpfult.

Thank you for your help.
 
G

Guest

Hi Damon,

I was able to somewhat "fix" my issue using a msgbox.

I used the following code:

Private Sub Form_Load()
If IsNull(DOCN) = False Or IsNull(ADN) = False Or IsNull(OTHN) = False Or
IsNull(SUPN) = False Then
MsgBox ("THERE ARE INTERNAL NOTES TO REVIEW")
End If

If IsNull(Note) = False Then
MsgBox ("THERE ARE CLIENT NOTES TO REVIEW")
End If
End Sub

Thanks for your help on this.
 
M

mcescher

Hi Damon,

I was able to somewhat "fix" my issue using a msgbox.

I used the following code:

Private Sub Form_Load()
If IsNull(DOCN) = False Or IsNull(ADN) = False Or IsNull(OTHN) = False Or
IsNull(SUPN) = False Then
MsgBox ("THERE ARE INTERNAL NOTES TO REVIEW")
End If

If IsNull(Note) = False Then
MsgBox ("THERE ARE CLIENT NOTES TO REVIEW")
End If
End Sub

Thanks for your help on this.







- Show quoted text -

The tab control has the ability to show pictures in the tabs. Perhaps
you could show a checkmark or a magnifying glass when there is data
available to view.

HTH,
Chris M.
 
D

Damon Heron

If a msg box is too intrusive, you could have a label above the page
controls, and set the label.caption to read what your msgbox would read.
The only problem I have with info msgboxes is the extra "click" the user has
to go thru. A label would inform the user when the form is loaded.
 
G

Guest

Hi Damon and Chris,

Well I really like the idea of showing the picture, like a checkmark,
however I am wondering how to have this showing and how to code my
application so that it only shows if there is data in certain fields.

What I'd like to be able to do is that from the main tab (page 1), if there
are notes in the internal notes tab (page 2), that the user sees either a
color change on tab page 2, or a picture, or a label, (I'm not picky with
this), but basically have something to tell them to go and look at page 2.
If the picture or label idea works for this, I would like to implement this
instead of the msg box idea, as stated by Damon, requires an extra click by
the user.

Thank you for your help and I look forward to hearing more from you.
 
D

Damon Heron

Use pretty much the same code as you have, except for two labels in the form
Header. If you don't have a form header, it might be a good location for
the labels, if you have room. There are two labels because of your if
statements are separate. You know your data better than I, so I am guessing
both events could be true -in which case, only the second msg would display
unless you have two labels. When placing the labels in design mode, give
them some caption or they won't stay. After form is loaded, then they can
be blank.

Damon


Private Sub Form_Load()
If IsNull(DOCN) = False Or IsNull(ADN) = False Or IsNull(OTHN) = False Or
IsNull(SUPN) = False Then
me.Label1.caption="THERE ARE INTERNAL NOTES TO REVIEW"
Else
me.Label1.caption=""
End If

If IsNull(Note) = False Then
me.Label2.caption="THERE ARE CLIENT NOTES TO REVIEW"

Else
me.Label2.caption=""
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top