|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Text Box ProblemHi, 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 try
If Val(txtAmount.Text) < Val (txtTotal.Text) Then "Pinto1uk" <Pinto***@discussions.microsoft.com> wrote in message Hi, can anyone tell me why the following line of code does not work. It news:A9B41128-DC8E-4FF3-BB80-02F3C8A9AAFE@microsoft.com... 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 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 Show quoteHide quote "Lance Wynn" wrote: > try > > If Val(txtAmount.Text) < Val (txtTotal.Text) Then > > "Pinto1uk" <Pinto***@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 > > > > > try
If Val(Mid((txtAmount.Text), 2)) < Val(Mid((txtTotal.Text), 2)) Then I think that it may be the "£" that is the problem Show quoteHide quote "Pinto1uk" <Pinto***@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: > > > try > > > > If Val(txtAmount.Text) < Val (txtTotal.Text) Then > > > > "Pinto1uk" <Pinto***@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 > > > > > > > > > > On Sun, 29 Jan 2006 22:20:38 -0000, "David Clifford"
<sarpg939tNoSpam@SomeISP.com> wrote: >try Yes, Val( "£100" ) is zero>If Val(Mid((txtAmount.Text), 2)) < Val(Mid((txtTotal.Text), 2)) Then > >I think that it may be the "£" that is the problem The OP would be better off disallowing or removing non numeric characters
Using Control Array in User Control
Why sending email programmatically must be so complicated? VB 2005 Express..NOT OT...really! File Copy Without Win Buffering Proper way to resize a Form VB6---.NET Passing data from a dll to the main VB program Problems with vbCtrlMask can't use a function from dll built in delphi VB crash on .PopupMenu .zmnuDemo Defaultmenu |
|||||||||||||||||||||||