Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Error Help ClearContents

Hi I am geting a error but not too sure why this line of code ,


Software_form.txtSoftware1.Value = ClearContents

compile error
variable not defined

I understand the error but I thought clearContents was build in variable the
code is in form

any help many thanks :P


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Error Help ClearContents

If it's a list box then you can do the following

lstBoxTest.Clear

but when you use the = sign you are trying to assign something to the
object, so even if the textBox (I'm guessing that's what it is) did have a
clear function it would be used by calling a method within the object like so

Software_form.txtSoftware1.Clear but that won't work.
Just do

Software_form.txtSoftware1.Value = ""

"millwalll" wrote:

Hi I am geting a error but not too sure why this line of code ,


Software_form.txtSoftware1.Value = ClearContents

compile error
variable not defined

I understand the error but I thought clearContents was build in variable the
code is in form

any help many thanks :P


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,069
Default Error Help ClearContents

When I check the VBA help (Excel 2003), I only see a ClearContents method,
not a "built-in variable". The ClearContents method only applies to ranges
and charts. I suggest you set the value of your textbox to vbNullString to
clear it:

Software_form.txtSoftware1.Value = vbNullString

Hope this helps,

Hutch

"millwalll" wrote:

Hi I am geting a error but not too sure why this line of code ,


Software_form.txtSoftware1.Value = ClearContents

compile error
variable not defined

I understand the error but I thought clearContents was build in variable the
code is in form

any help many thanks :P


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBS Script and ClearContents -- Code Throws An Error garibaldi Excel Programming 4 November 15th 07 03:45 AM
Clearcontents Caroline Vincent Excel Programming 2 September 9th 04 11:03 AM
ClearContents in event proc raises error JM[_5_] Excel Programming 0 July 1st 04 09:11 PM
Clearcontents Dick Kusleika[_3_] Excel Programming 0 February 17th 04 05:42 PM
Error of ClearContents Richard[_23_] Excel Programming 1 January 1st 04 12:23 PM


All times are GMT +1. The time now is 09:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"