Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

Formating Listview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lina Manjarres - 31 Jan 2006 04:28 GMT
I have to compare two columns of a listview.
I use this:
If lvw_Asign.ListItems(X).ListSubItems(4) >
lvw_Asign.ListItems(X).ListSubItems(5) Then

but if the numbers are if 47 < 490 then, the result is that 490 is not
bigger than 47 .

How can I make this comparative situation to work?

Thanks a lot, Lina
Alex Dybenko - 31 Jan 2006 06:37 GMT
Try to "convert" to numbers:

If Val(lvw_Asign.ListItems(X).ListSubItems(4)) >
Val(lvw_Asign.ListItems(X).ListSubItems(5)) Then

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

>I have to compare two columns of a listview.
> I use this:
[quoted text clipped - 7 lines]
>
> Thanks a lot, Lina
Lina Manjarres - 31 Jan 2006 13:35 GMT
Hi Alex,
I did that, but it did not work.
What I did, and it worked is that I added a 0 to each side of the equation
like this:
lvw_Asign.ListItems(X).ListSubItems(4) +0 >
lvw_Asign.ListItems(X).ListSubItems(5) +0 Then
And it worked. Why? I do not know...

Thanks a lot, Lina

> Try to "convert" to numbers:
>
[quoted text clipped - 12 lines]
> >
> > Thanks a lot, Lina
Alex Dybenko - 31 Jan 2006 17:45 GMT
Well, this is strange, but fine if it works
once you made:
lvw_Asign.ListItems(X).ListSubItems(4) +0
then value of lvw_Asign.ListItems(X).ListSubItems(4) was converted to
number, in order to add 0 (also number) - that is why you get correct result
Val() function do the same thing, but for some reason it did not work here

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Hi Alex,
> I did that, but it did not work.
[quoted text clipped - 22 lines]
>> >
>> > Thanks a lot, Lina
 
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.