Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Text Box Problem
Hi, can anyone tell me why the following line of code does not work. It work
s
for example whenever the txtAmount > 1. but if i enter enter anything below
1, the code does not perform the way i want. the code does not work when i
play around with decimal numbers.

If txtAmount.Text < Val (txtTotal.Text) Then ...

regards




Report this thread to moderator Post Follow-up to this message
Old Post
Pinto1uk
01-29-06 11:55 PM


Re: Text Box Problem
try

If Val(txtAmount.Text) < Val (txtTotal.Text) Then

"Pinto1uk" <Pinto1uk@discussions.microsoft.com> wrote in message
news:A9B41128-DC8E-4FF3-BB80-02F3C8A9AAFE@microsoft.com...
Hi, can anyone tell me why the following line of code does not work. It
works
for example whenever the txtAmount > 1. but if i enter enter anything below
1, the code does not perform the way i want. the code does not work when i
play around with decimal numbers.

If txtAmount.Text < Val (txtTotal.Text) Then ...

regards





Report this thread to moderator Post Follow-up to this message
Old Post
Lance Wynn
01-29-06 11:55 PM


Re: Text Box Problem
Hi, ive tried that with no luck. the problem occurs only when the total is
less than 1. eg £0.90. and when i try and enter 0.95, the calculation becom
es
errornous.

regards

"Lance Wynn" wrote:

> try
>
> If Val(txtAmount.Text) < Val (txtTotal.Text) Then
>
> "Pinto1uk" <Pinto1uk@discussions.microsoft.com> wrote in message
> news:A9B41128-DC8E-4FF3-BB80-02F3C8A9AAFE@microsoft.com...
> Hi, can anyone tell me why the following line of code does not work. It
> works
> for example whenever the txtAmount > 1. but if i enter enter anything belo
w
> 1, the code does not perform the way i want. the code does not work when i
> play around with decimal numbers.
>
> If txtAmount.Text < Val (txtTotal.Text) Then ...
>
> regards
>
>
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
Pinto1uk
01-29-06 11:55 PM


Re: Text Box Problem
try
If Val(Mid((txtAmount.Text), 2)) < Val(Mid((txtTotal.Text), 2)) Then

I think that it may be the "£" that is the problem

"Pinto1uk" <Pinto1uk@discussions.microsoft.com> wrote in message
news:D1B60C4C-A90F-4EA2-958E-5CE232172D79@microsoft.com...
> Hi, ive tried that with no luck. the problem occurs only when the total is
> less than 1. eg £0.90. and when i try and enter 0.95, the calculation
becomes
> errornous.
>
> regards
>
> "Lance Wynn" wrote:
> 
below 
i 



Report this thread to moderator Post Follow-up to this message
Old Post
David Clifford
01-29-06 11:55 PM


Re: Text Box Problem
On Sun, 29 Jan 2006 22:20:38 -0000, "David Clifford"
<sarpg939tNoSpam@SomeISP.com> wrote:

>try
>If Val(Mid((txtAmount.Text), 2)) < Val(Mid((txtTotal.Text), 2)) Then
>
>I think that it may be the "£" that is the problem

Yes,  Val( "£100" )  is zero

The OP would be better off disallowing or removing non numeric
characters

Report this thread to moderator Post Follow-up to this message
Old Post
J French
01-30-06 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:14 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.