PC Review


Reply
Thread Tools Rate Thread

Clear content of textbox in userform

 
 
=?Utf-8?B?QmlrYXNo?=
Guest
Posts: n/a
 
      27th Jun 2007
Hello!

I would like to clear the content of single textboxes of my userform.

To clear all content I use a commandbutton which works fine. When I select a
specific textbox and press the delete key the textbox looks empty. Then I
click the button "save changes" using the code below but the change is not
saved to my table. When I change values the change will be saved to the table.

Private Sub cmd_save_Click ()
ActiveCell.Offset(0, 47) = CDbl(txt_fwdEUR)
ActiveCell.Offset(0, 48) = CDbl(txt_janEUR)
ActiveCell.Offset(0, 49) = CDbl(txt_febEUR)
ActiveCell.Offset(0, 50) = CDbl(txt_marEUR)
ActiveCell.Offset(0, 51) = CDbl(txt_aprEUR)
ActiveCell.Offset(0, 52) = CDbl(txt_mayEUR)
ActiveCell.Offset(0, 53) = CDbl(txt_junEUR)
ActiveCell.Offset(0, 54) = CDbl(txt_julEUR)
ActiveCell.Offset(0, 55) = CDbl(txt_augEUR)
ActiveCell.Offset(0, 56) = CDbl(txt_sepEUR)
ActiveCell.Offset(0, 57) = CDbl(txt_octEUR)
ActiveCell.Offset(0, 58) = CDbl(txt_novEUR)
ActiveCell.Offset(0, 59) = CDbl(txt_decEUR)
End Sub

How can I solve it?

Best regards,

Bodo Frost
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      27th Jun 2007
cdbl("")

raises an error for me [type mismatch]. Perhaps you are suppressing the
error and don't realize it has occured (and prevented the update).

--
Regards,
Tom Ogilvy


"Bikash" wrote:

> Hello!
>
> I would like to clear the content of single textboxes of my userform.
>
> To clear all content I use a commandbutton which works fine. When I select a
> specific textbox and press the delete key the textbox looks empty. Then I
> click the button "save changes" using the code below but the change is not
> saved to my table. When I change values the change will be saved to the table.
>
> Private Sub cmd_save_Click ()
> ActiveCell.Offset(0, 47) = CDbl(txt_fwdEUR)
> ActiveCell.Offset(0, 48) = CDbl(txt_janEUR)
> ActiveCell.Offset(0, 49) = CDbl(txt_febEUR)
> ActiveCell.Offset(0, 50) = CDbl(txt_marEUR)
> ActiveCell.Offset(0, 51) = CDbl(txt_aprEUR)
> ActiveCell.Offset(0, 52) = CDbl(txt_mayEUR)
> ActiveCell.Offset(0, 53) = CDbl(txt_junEUR)
> ActiveCell.Offset(0, 54) = CDbl(txt_julEUR)
> ActiveCell.Offset(0, 55) = CDbl(txt_augEUR)
> ActiveCell.Offset(0, 56) = CDbl(txt_sepEUR)
> ActiveCell.Offset(0, 57) = CDbl(txt_octEUR)
> ActiveCell.Offset(0, 58) = CDbl(txt_novEUR)
> ActiveCell.Offset(0, 59) = CDbl(txt_decEUR)
> End Sub
>
> How can I solve it?
>
> Best regards,
>
> Bodo Frost

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[2008] Clear contents of textbox, reverting transaction with textbox method undo Rob W Microsoft VB .NET 0 6th Mar 2009 10:39 AM
fill userform textbox from userform listbox clik event GregJG Microsoft Excel Programming 1 7th Dec 2008 02:05 PM
Add RFT File Content and Page Break and then Content of other textbox sivachitra81@gmail.com Microsoft Dot NET 0 23rd Feb 2007 12:46 PM
content on textbox within userform =?Utf-8?B?c3ZlcnJl?= Microsoft Excel Programming 2 22nd Aug 2006 07:47 AM
Re: UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E Microsoft Excel Programming 1 28th Jul 2003 07:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:29 PM.