PC Review


Reply
 
 
=?Utf-8?B?Smlt?=
Guest
Posts: n/a
 
      29th Jun 2007
I have a user form with 2 pages "invoice address" and "delivery address" the
user enters details into some text boxes which then sends info to the
spreadsheet.

On occasion the invoice details and the delivery details are the same so i
added a check box at the bottom of the form end entered the following code:

Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
TextBox11.Value = TextBox1.Value
textbox12.value=textbox2.value
End If
end sub

thh problem id when you click the box it only filles in textbox11 to get it
to fill in textbox12 you have to click the checkbox again.

Can anyone help?
 
Reply With Quote
 
 
 
 
Bob Flanagan
Guest
Posts: n/a
 
      29th Jun 2007
Your code looks fine. Is this your actual code? It looks like you typed it
in, and I suspect your actual code is different.

I would put a breakpoint on the first line of code and then step through
the code when you click the button. I particular, I would put watches on
the different parts. For example, a watch on textbox2.value to see if it
truely has a value when one clicks the button.

Bob Flanagan
Macro Systems
144 Dewberry Drive
Hockessin, Delaware, U.S. 19707

Phone: 302-234-9857, cell 302-584-1771
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

"Jim" <(E-Mail Removed)> wrote in message
news:64EC3E89-4B40-4325-BA64-(E-Mail Removed)...
>I have a user form with 2 pages "invoice address" and "delivery address"
>the
> user enters details into some text boxes which then sends info to the
> spreadsheet.
>
> On occasion the invoice details and the delivery details are the same so i
> added a check box at the bottom of the form end entered the following
> code:
>
> Private Sub CheckBox1_Click()
> If CheckBox1.Value = True Then
> TextBox11.Value = TextBox1.Value
> textbox12.value=textbox2.value
> End If
> end sub
>
> thh problem id when you click the box it only filles in textbox11 to get
> it
> to fill in textbox12 you have to click the checkbox again.
>
> Can anyone help?



 
Reply With Quote
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      29th Jun 2007
Jim,

The code below won't cause that problem, it works perfectly provided
checkboxes 1 & 2 are populated. Have a look at how you are doing that.

Mike

"Jim" wrote:

> I have a user form with 2 pages "invoice address" and "delivery address" the
> user enters details into some text boxes which then sends info to the
> spreadsheet.
>
> On occasion the invoice details and the delivery details are the same so i
> added a check box at the bottom of the form end entered the following code:
>
> Private Sub CheckBox1_Click()
> If CheckBox1.Value = True Then
> TextBox11.Value = TextBox1.Value
> textbox12.value=textbox2.value
> End If
> end sub
>
> thh problem id when you click the box it only filles in textbox11 to get it
> to fill in textbox12 you have to click the checkbox again.
>
> Can anyone help?

 
Reply With Quote
 
=?Utf-8?B?Smlt?=
Guest
Posts: n/a
 
      29th Jun 2007
ok i've found out what the problem is but it's caused another.

if i remove the control source from each of the text boxes on the delivery
address the code works fine but the information now no longer transfers onto
the spreadsheet.

"Mike H" wrote:

> Jim,
>
> The code below won't cause that problem, it works perfectly provided
> checkboxes 1 & 2 are populated. Have a look at how you are doing that.
>
> Mike
>
> "Jim" wrote:
>
> > I have a user form with 2 pages "invoice address" and "delivery address" the
> > user enters details into some text boxes which then sends info to the
> > spreadsheet.
> >
> > On occasion the invoice details and the delivery details are the same so i
> > added a check box at the bottom of the form end entered the following code:
> >
> > Private Sub CheckBox1_Click()
> > If CheckBox1.Value = True Then
> > TextBox11.Value = TextBox1.Value
> > textbox12.value=textbox2.value
> > End If
> > end sub
> >
> > thh problem id when you click the box it only filles in textbox11 to get it
> > to fill in textbox12 you have to click the checkbox again.
> >
> > Can anyone help?

 
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
When user press F5 after a button click event, the click event fires again! Max2006 Microsoft ASP .NET 2 19th Sep 2007 06:37 AM
How to raise an event of button (click event) from textbox's onkeydown event? ABC Microsoft Dot NET Framework Forms 2 25th Jul 2006 11:19 AM
Wire up a click event within another click event doesn't work... Chu Microsoft ASP .NET 2 10th Apr 2006 11:43 PM
Button.Init? how Do I know if click event has been fired? TextBox.TextChanged event before Button.Click in a CompositeCustomControl. jorge Microsoft ASP .NET 2 26th May 2004 12:45 AM
How to block itemcheck event when i double click in a listView (not click on the checkbox) Bright Sun Microsoft C# .NET 0 28th Jan 2004 04:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:29 AM.