T
Turbo
Hope someone can help me with this. I am trying to get the font in the
control boxes to turn red when value is less than 4 or when in the function
text control indicates "INDICATION. I am using access 2003 and the
page is not grouped. Been searching for days on this and my VB Script talent
is slim to none.
Here is the code that I came up with:
<SCRIPT language=vbscript for=MSODSC event=OnCurrent(oEventInfo)>
<!--
' Highlight indication function.
dim sect
dim dscconst
dim bandHTML
' Check that the event fired for the DataPage in the FUNC_PRTY
If (oEventInfo.DataPage.RecordSource = "Recordset: ADPage Query") Then
Set dscconst = MSODSC.Constants
Set sect = oEventInfo.DataPage.FirstSection
' Go through the sections of the event's DataPage object.
Do
' Ignore all sections except the header section.
If (sect.Type = dscconst.sectTypeHeader) Then
Set bandHTML = sect.HTMLContainer
' Change the text to red if function is <= 4
' priorty.
If (CInt(bandHTML.children("FUNC_PRTY").innerText) _
<= 4 ) Then
bandHTML.children("FUNC_PRTY").style. _
color = "red"
bandHTML.children("FUNCTION").style.color = "red"
bandHTML.children("TAGNAME").style.color = "red"
End If
End If
Set sect = sect.NextSibling
Loop until (sect is nothing)
End If
-->
</SCRIPT>
Any help would be greatly appreciated.
I am also wondering if there is a way to make it blink and where I could
find information on that?
control boxes to turn red when value is less than 4 or when in the function
text control indicates "INDICATION. I am using access 2003 and the
page is not grouped. Been searching for days on this and my VB Script talent
is slim to none.
Here is the code that I came up with:
<SCRIPT language=vbscript for=MSODSC event=OnCurrent(oEventInfo)>
<!--
' Highlight indication function.
dim sect
dim dscconst
dim bandHTML
' Check that the event fired for the DataPage in the FUNC_PRTY
If (oEventInfo.DataPage.RecordSource = "Recordset: ADPage Query") Then
Set dscconst = MSODSC.Constants
Set sect = oEventInfo.DataPage.FirstSection
' Go through the sections of the event's DataPage object.
Do
' Ignore all sections except the header section.
If (sect.Type = dscconst.sectTypeHeader) Then
Set bandHTML = sect.HTMLContainer
' Change the text to red if function is <= 4
' priorty.
If (CInt(bandHTML.children("FUNC_PRTY").innerText) _
<= 4 ) Then
bandHTML.children("FUNC_PRTY").style. _
color = "red"
bandHTML.children("FUNCTION").style.color = "red"
bandHTML.children("TAGNAME").style.color = "red"
End If
End If
Set sect = sect.NextSibling
Loop until (sect is nothing)
End If
-->
</SCRIPT>
Any help would be greatly appreciated.
I am also wondering if there is a way to make it blink and where I could
find information on that?