Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

urgent help needed please anyone

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Newbee - 23 Feb 2006 13:46 GMT
hello everyone as iam new to VB i have a small query which iam trying
to solve.
I have designed a form with three check boxes and one texbox which is
connected to a column in a table.

when i check one of the check boxes or all of them i want to copy the
checkbox label text to the textbox to store in the table. to achieve
this i defined a string in the on click event procedure of the CLOSE
Button on the form.

If i use this string in the on-click event procedure of the check box
its giving me this error "RUNTIME ERROR 2115". Thts the Reason i used
the string in the CLOSE command button (which doesnt give any runtime
error).

The problem comes when i click all the three check boxes the textbox is
only storing the recent value. but not all the three values. I have
attached the code please go through the string i have written in the
CLOSE Button event Procedure.

Comments.SetFocus
Dim options As String
options = Comments.Text
If chkCoverstory.Value = True Then
Comments.Text = Label3.Caption & options
If ChkNews.Value = True Then
Comments.Text = Label5.Caption & options
If ChkRegulars.Value = True Then
Comments.Text = Label7.Caption & options
End If

Any help is greatly appreciated. Thanks in advance.
Charlie - 23 Feb 2006 15:29 GMT
Try:

Dim options As String

options = ""
If ChkCoverstory Then options = Label3.Caption
If ChkNews Then options = Label5.Caption & options
If ChkRegulars Then options = Label7.Caption & options
Comments.Text = options & Comments.Text

> hello everyone as iam new to VB i have a small query which iam trying
> to solve.
[quoted text clipped - 28 lines]
>
> Any help is greatly appreciated. Thanks in advance.
Newbee - 23 Feb 2006 20:22 GMT
hi charlie,

Thanks for the reply it works only when i click all the check boxes
when i click only one checkbox then it gives me a runtime error 4 '
Invalid use of null'. any suggestions.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.