I've got a multi-page subform with a tab control on one of the pages. The code that moves you from page three to page four, which is where the tab is, changes the tab captions according to some information stored in a table. Only it's not working. Actually, it is working, and then it's unworking.
The tab caption starts out "And...". Depending on what's in the table, the caption may get changed to "Or...".
Here's the code that makes the changes, from two different functions:
In both cases I've got proper with/end with structures. In both cases I've inserted debug.print statements for testing (including the function name). In the second function I've replaced the value that should be shown with "Test Caption", just for testing purposes.
Here's what shows up in the immediate window:
Pre ShowAndNameTags: And...
Pre SetAndOr: And...
Post SetAndOr: Test Caption
Post ShowAndNameTags change:
This happens whether or not I leave the original strCaption as the value for the caption, and it happens no matter wht strCaption evaluates to.
Does anyone know why the caption would go blank? I've looked around here and on CDMA and other places but not found even a hint of a similar problem anyone had. Any help would be muchly appreciated.
Jeremy Wallace
---
Jeremy Wallace
METRIX Project Coordinator
Fund for the City of New York
The tab caption starts out "And...". Depending on what's in the table, the caption may get changed to "Or...".
Here's the code that makes the changes, from two different functions:
Code:
Debug.Print "Pre ShowAndNameTags: " & .Pg2.Caption
If !msfConditions2.Rows <> 1 Then
.Pg3.Visible = True
.Pg2.Caption = SetAndOr(1)
End If
Debug.Print "Post ShowAndNameTags change: " & .Pg2.Caption
=====
Debug.Print "Pre SetAndOr: " & .Pg2.Caption
If intpage = 0 Then
intpage = !tabQuery.Value
End If
strCaption = IIf(.Controls("fraAndOr" & intpage + 1) = 1, "Or...", "And...")
!tabQuery.Pages(intpage).Caption = "Test Caption" ' strCaption
Debug.Print "Post SetAndOr: " & .Pg2.Caption
=====
In both cases I've got proper with/end with structures. In both cases I've inserted debug.print statements for testing (including the function name). In the second function I've replaced the value that should be shown with "Test Caption", just for testing purposes.
Here's what shows up in the immediate window:
Pre ShowAndNameTags: And...
Pre SetAndOr: And...
Post SetAndOr: Test Caption
Post ShowAndNameTags change:
This happens whether or not I leave the original strCaption as the value for the caption, and it happens no matter wht strCaption evaluates to.
Does anyone know why the caption would go blank? I've looked around here and on CDMA and other places but not found even a hint of a similar problem anyone had. Any help would be muchly appreciated.
Jeremy Wallace
---
Jeremy Wallace
METRIX Project Coordinator
Fund for the City of New York