control caption based on input

  • Thread starter Thread starter newbie
  • Start date Start date
N

newbie

I'm new to Access, and am using Access 97.
I'm working on a form with tabs, to utilize space, and so
far everything
works fine.
the only problem is that if I have something entered into
a memofield/TextBox
on another page, it is difficult to know if anything has
been entered unless
I go to that page.
So far, I have come up with an if statement that helps out
somewhat.
As long as the default value exists which is "".

Here is my code:

If Me!occurrence.Value = "" Then
Me.TabCtl0.Pages("page2").Caption = "Occurrence"
Else
Me.TabCtl0.Pages("Page2").Caption = "Occurrence
ENTERED"
End If

However, If I delete the entry in the textbox, the caption
still reads
"Occurrence ENTERED".

In short, I would like the tab to read "Occurrence" if
there is nothing
in the field, and "Occurrence ENTERED" if there is
something entered.

Any help/suggestions will be appreciated.
 
It all depends on where you have placed your code.
I would put it in the KeyUp event of the textbox
 
The AfterUpdate event of a textbox control can do whatever you want to do
when the text in that box has been added, edited or erased. Use that event
to update the tab control page captions.

HTH,
TC
 
Back
Top