Group:  Microsoft Access ยป microsoft.public.access.dataaccess.pages
Thread: Problem with growing text box.

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Problem with growing text box.
cdoyle[ at ]oz.net 17.07.2006 15:22:56
Hello,

I have a text comment field on my DAP, and I've search this site for
how to make it grow as needed.

I found this code

<SCRIPT language=vbscript event=DataPageComplete(dscei) for=MSODSC>
<!--
Dim dscconst
Dim sec
Dim el

Set c = MSODSC.Constants
Set sec = dscei.DataPage.FirstSection
While (not(sec is nothing))
If (sec.type = c.sectTypeHeader) Then
Set el = sec.HTMLContainer.children("Comments")
sec.HTMLContainer.style.height = el.offsetTop + el.offsetHeight
+ 5
End If
Set sec = sec.NextSibling
Wend
-->
</SCRIPT>



this seems to work, but I get an error in the browser. The error says

Error: Object required: 'el'
code 0

Is there more to this script that I need to add?

thanks
Chris.

Re: Problem with growing text box.
"PaulD" <nospam> 17.07.2006 19:21:05
my first guess (and I do mean guess) would be you are still in the loop but
el was not set to an object. So, is it possible that sec.type =
c.sectTypeHeader but there is not container named "Comments" so el had
nothing to be assigned to?

Paul D

<cdoyle[ at ]oz.net> wrote in message
news:1153149775.994117.298300[ at ]m73g2000cwd.googlegroups.com...
: Hello,
:
: I have a text comment field on my DAP, and I've search this site for
: how to make it grow as needed.
:
: I found this code
:
: <SCRIPT language=vbscript event=DataPageComplete(dscei) for=MSODSC>
: <!--
: Dim dscconst
: Dim sec
: Dim el
:
: Set c = MSODSC.Constants
: Set sec = dscei.DataPage.FirstSection
: While (not(sec is nothing))
: If (sec.type = c.sectTypeHeader) Then
: Set el = sec.HTMLContainer.children("Comments")
: sec.HTMLContainer.style.height = el.offsetTop + el.offsetHeight
: + 5
: End If
: Set sec = sec.NextSibling
: Wend
: -->
: </SCRIPT>
:
:
:
: this seems to work, but I get an error in the browser. The error says
:
: Error: Object required: 'el'
: code 0
:
: Is there more to this script that I need to add?
:
: thanks
: Chris.
:


Re: Problem with growing text box.
cdoyle[ at ]oz.net 17.07.2006 20:39:35
I took this code out of another post I found on here, originally
'Comments' was labled 'description'.

So I changed it to the name of my field, and it actually does work, but
I just get that darn error each time the page is accessed.

If I try and view the page within access I get the same error like 5
times, so it does sound like it's stuck in a loop.

any ideas how to fix it?

thanks
Chris.


PaulD wrote:
[Quoted Text]
> my first guess (and I do mean guess) would be you are still in the loop but
> el was not set to an object. So, is it possible that sec.type =
> c.sectTypeHeader but there is not container named "Comments" so el had
> nothing to be assigned to?
>
> Paul D
>
> <cdoyle[ at ]oz.net> wrote in message
> news:1153149775.994117.298300[ at ]m73g2000cwd.googlegroups.com...
> : Hello,
> :
> : I have a text comment field on my DAP, and I've search this site for
> : how to make it grow as needed.
> :
> : I found this code
> :
> : <SCRIPT language=vbscript event=DataPageComplete(dscei) for=MSODSC>
> : <!--
> : Dim dscconst
> : Dim sec
> : Dim el
> :
> : Set c = MSODSC.Constants
> : Set sec = dscei.DataPage.FirstSection
> : While (not(sec is nothing))
> : If (sec.type = c.sectTypeHeader) Then
> : Set el = sec.HTMLContainer.children("Comments")
> : sec.HTMLContainer.style.height = el.offsetTop + el.offsetHeight
> : + 5
> : End If
> : Set sec = sec.NextSibling
> : Wend
> : -->
> : </SCRIPT>
> :
> :
> :
> : this seems to work, but I get an error in the browser. The error says
> :
> : Error: Object required: 'el'
> : code 0
> :
> : Is there more to this script that I need to add?
> :
> : thanks
> : Chris.
> :

Re: Problem with growing text box.
"PaulD" <nospam> 19.07.2006 22:22:17
Can you send me the files?
Paul D

<cdoyle[ at ]oz.net> wrote in message
news:1153168774.982745.215680[ at ]b28g2000cwb.googlegroups.com...
: I took this code out of another post I found on here, originally
: 'Comments' was labled 'description'.
:
: So I changed it to the name of my field, and it actually does work, but
: I just get that darn error each time the page is accessed.
:
: If I try and view the page within access I get the same error like 5
: times, so it does sound like it's stuck in a loop.
:
: any ideas how to fix it?
:
: thanks
: Chris.
:
:
: PaulD wrote:
: > my first guess (and I do mean guess) would be you are still in the loop
but
: > el was not set to an object. So, is it possible that sec.type =
: > c.sectTypeHeader but there is not container named "Comments" so el had
: > nothing to be assigned to?
: >
: > Paul D
: >
: > <cdoyle[ at ]oz.net> wrote in message
: > news:1153149775.994117.298300[ at ]m73g2000cwd.googlegroups.com...
: > : Hello,
: > :
: > : I have a text comment field on my DAP, and I've search this site for
: > : how to make it grow as needed.
: > :
: > : I found this code
: > :
: > : <SCRIPT language=vbscript event=DataPageComplete(dscei) for=MSODSC>
: > : <!--
: > : Dim dscconst
: > : Dim sec
: > : Dim el
: > :
: > : Set c = MSODSC.Constants
: > : Set sec = dscei.DataPage.FirstSection
: > : While (not(sec is nothing))
: > : If (sec.type = c.sectTypeHeader) Then
: > : Set el = sec.HTMLContainer.children("Comments")
: > : sec.HTMLContainer.style.height = el.offsetTop +
el.offsetHeight
: > : + 5
: > : End If
: > : Set sec = sec.NextSibling
: > : Wend
: > : -->
: > : </SCRIPT>
: > :
: > :
: > :
: > : this seems to work, but I get an error in the browser. The error
says
: > :
: > : Error: Object required: 'el'
: > : code 0
: > :
: > : Is there more to this script that I need to add?
: > :
: > : thanks
: > : Chris.
: > :
:


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net