By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,681 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,681 IT Pros & Developers. It's quick & easy.

HELP: How do I fill two or more lables using an IF THEN statement

P: n/a
Hello, I would like to fill more than one lable with info in an IF then
statement.

I know I can do this.

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal)
end if
what if I have both lblsubtotal and lblfinaltotal.....how would also
populate lblfinaltotal.text with the mdecPizzatotal within that if than
statement?

I tried this, but got errors...

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) And lblFinaltotal.text =
FormatCurrency(mdecPizzatotal)
end if

thank for any help.

Nov 20 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
The easiest way seems to be just get rid of the "and" and make two seperate
statements, No?

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=FormatCurrency(mdecPizzatotal)
end if

Or how about:
If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=lblsubtotal.text
end if
--

/ Sean Mc /
Replace the "wish" with the screen name to contact.

"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"Jason" <no**@none.invalid> wrote in message
news:uq**************@TK2MSFTNGP12.phx.gbl...
Hello, I would like to fill more than one lable with info in an IF then
statement.

I know I can do this.

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal)
end if
what if I have both lblsubtotal and lblfinaltotal.....how would also
populate lblfinaltotal.text with the mdecPizzatotal within that if than
statement?

I tried this, but got errors...

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) And lblFinaltotal.text =
FormatCurrency(mdecPizzatotal)
end if

thank for any help.

Nov 20 '05 #2

P: n/a
On Sat, 4 Oct 2003 21:01:09 -0400, "Jason" <no**@none.invalid> wrote:
Hello, I would like to fill more than one lable with info in an IF then
statement.

I know I can do this.

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal)
end if
what if I have both lblsubtotal and lblfinaltotal.....how would also
populate lblfinaltotal.text with the mdecPizzatotal within that if than
statement?

I tried this, but got errors...

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) And lblFinaltotal.text =
FormatCurrency(mdecPizzatotal)
end if

thank for any help.


Like this:

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal)
lblFinaltotal.text = FormatCurrency(mdecPizzatotal)
End If

// CHRIS

Nov 20 '05 #3

P: n/a
Nak
Hi there,
If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=FormatCurrency(mdecPizzatotal)
end if

Or how about:
If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=lblsubtotal.text
end if


? You sure earnt your name!

Nick.

--
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
"No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
Nov 20 '05 #4

P: n/a
"Jason" <no**@none.invalid> scripsit:
I would like to fill more than one lable with info in an IF then
statement.

I know I can do this.

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal)
end if
what if I have both lblsubtotal and lblfinaltotal.....how would also
populate lblfinaltotal.text with the mdecPizzatotal within that if than
statement?

I tried this, but got errors...

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) And lblFinaltotal.text =
FormatCurrency(mdecPizzatotal)
end if


\\\
If radPizza.Checked Then
lblSubTotal.Text = ...
lblFinalTotal.Text = ...
End If
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

P: n/a
"What-a-Tool" <Fr***********************@cox.net> scripsit:
The easiest way seems to be just get rid of the "and" and make two seperate
statements, No?

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=FormatCurrency(mdecPizzatotal)
end if

Or how about:
If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=lblsubtotal.text
end if


The statements must be separated with a newline or ":".

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #6

P: n/a
Sorry - Didn't check my text after post -
when I sent it they were all on seperate lines as they should have been.
They weren't posted that way, though
If radPizza.checked = true then

lblsubtotal.text = FormatCurrency(mdecPizzatotal)

lblFinaltotal.text=FormatCurrency(mdecPizzatotal)

end if
Or how about: If radPizza.checked = true then

lblsubtotal.text = FormatCurrency(mdecPizzatotal)

lblFinaltotal.text=lblsubtotal.text

end if
This is what I thought I sent

--

/ Sean Mc /
Replace the "wish" with the screen name to contact.

"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"What-a-Tool" <Fr***********************@cox.net> wrote in message
news:odLfb.40528$0Z5.39531@lakeread03... The easiest way seems to be just get rid of the "and" and make two seperate statements, No?

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=FormatCurrency(mdecPizzatotal)
end if

Or how about:
If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=lblsubtotal.text
end if
--

/ Sean Mc /
Replace the "wish" with the screen name to contact.

"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"Jason" <no**@none.invalid> wrote in message
news:uq**************@TK2MSFTNGP12.phx.gbl...
Hello, I would like to fill more than one lable with info in an IF then
statement.

I know I can do this.

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal)
end if
what if I have both lblsubtotal and lblfinaltotal.....how would also
populate lblfinaltotal.text with the mdecPizzatotal within that if than
statement?

I tried this, but got errors...

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) And lblFinaltotal.text = FormatCurrency(mdecPizzatotal)
end if

thank for any help.


Nov 20 '05 #7

P: n/a
Cor
"Herfried K. Wagner
\\\
If radPizza.Checked Then
lblSubTotal.Text = ...
lblFinalTotal.Text = ...
End If

Better is the solution from What-a-tool
If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal)
lblFinaltotal.text=lblsubtotal.text
end if
Although it is very very very very slight
:-)))))))))))))
Cor

Nov 20 '05 #8

P: n/a
Awww - Jeeez!!
I finally saw a problem that was basic enough for me to reply to and I
F**ked it up. It was that freekin'
poltergeist that lives in my keyboard!
Yeah - Yeah! Thats what it was!
What - a Freakin Tool!!

--

/ Sean Mc /
Replace the "wish" with the screen name to contact.

"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"Nak" <a@a.com> wrote in message
news:O$**************@TK2MSFTNGP09.phx.gbl...
Hi there,
If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=FormatCurrency(mdecPizzatotal)
end if

Or how about:
If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=lblsubtotal.text
end if
? You sure earnt your name!

Nick.

--

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ "No matter. Whatever the outcome, you are changed."

Fergus - September 5th 2003
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

Nov 20 '05 #9

P: n/a
"Cor" <no*@non.com> scripsit:
Better is the solution from What-a-tool
If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal)
lblFinaltotal.text=lblsubtotal.text
end if
Although it is very very very very slight


Ah, I missed that both labels should be filled with the same value...

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #10

P: n/a
Hi What-a-Tool,

ROFL.

Never mind - "You have not failed. You've just found 1 way that didn't
work."

Condolences and/or congratulations,
Fergus


Nov 20 '05 #11

P: n/a
"What-a-Tool" <Fr***********************@cox.net> wrote in message
news:LZWfb.42006$0Z5.24976@lakeread03...
Sorry - Didn't check my text after post -
when I sent it they were all on seperate lines as they should have been.
They weren't posted that way, though
If radPizza.checked = true then

lblsubtotal.text = FormatCurrency(mdecPizzatotal)

lblFinaltotal.text=FormatCurrency(mdecPizzatotal)

end if

Ah yes, thats what I did, great, it worked, thanks.

Or how about:
If radPizza.checked = true then

lblsubtotal.text = FormatCurrency(mdecPizzatotal)

lblFinaltotal.text=lblsubtotal.text

end if


This is what I thought I sent

--

/ Sean Mc /
Replace the "wish" with the screen name to contact.

"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"What-a-Tool" <Fr***********************@cox.net> wrote in message
news:odLfb.40528$0Z5.39531@lakeread03...
The easiest way seems to be just get rid of the "and" and make two

seperate
statements, No?

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=FormatCurrency(mdecPizzatotal)
end if

Or how about:
If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) lblFinaltotal.text
=lblsubtotal.text
end if
--

/ Sean Mc /
Replace the "wish" with the screen name to contact.

"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)

"Jason" <no**@none.invalid> wrote in message
news:uq**************@TK2MSFTNGP12.phx.gbl...
Hello, I would like to fill more than one lable with info in an IF then statement.

I know I can do this.

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal)
end if
what if I have both lblsubtotal and lblfinaltotal.....how would also
populate lblfinaltotal.text with the mdecPizzatotal within that if than statement?

I tried this, but got errors...

If radPizza.checked = true then
lblsubtotal.text = FormatCurrency(mdecPizzatotal) And

lblFinaltotal.text = FormatCurrency(mdecPizzatotal)
end if

thank for any help.



Nov 20 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.