If textbox.text = "$1.00" then Val("$1.00") will = 0 because of the $. This is reason your total is 0.
So here are a couple of options.
1) Remove the $ from each textbox before using the Val function
2) Change all of your textboxes to Masked Edit boxes with the Format property set to...
I couldn't get your way to work either. But, until something better comes along, this is what I came up with.
Private Const NumOfColumns = 3 'Change this to the number of columns in your listview
Private ColText(NumOfColumns) As String
Private Sub cmdMoveUp_Click()
Dim itmX As ListItem...
Try something like this
Dim itm As ListItem
For T = 1 To 5
Set itm = ListView1.ListItems.Add(, "Item" & Cstr(T), "A")
itmX.SubItems(1) = "B"
itmX.SubItems(2) = "C"
itmX.SubItems(3) = "D"
Next T
Hope this helps
If I understand correctly, you want all selected items to land on the clipboard at once. Something like this should work.
Dim i As Integer
Dim strClip As String
strClip = ""
With List1
For i = 0 To .ListCount - 1
If .Selected(i) Then strClip = strClip &...
This may not be the best way to handle it, but you can try this. Use another picturebox to hold the original picture as you draw your line.
picOriginal.Visible = False
Then apply these changes to your code.
Option Explicit
Dim LinCol as Long 'Not String
Private Declare Function BitBlt Lib...
I've never tried Visual Studio Installer. Does it automatically include all for the .ocx's and .dll's that your app is dependant on like PDW?
I have a favorite setup packager, but, first I'll run PDW to create the setup.lst. Then I'll use that list in the other packager where I have more...
Thanks chiph and Robse. Those are good work-around ideas also. And I probably would have gone one of those routes had johnwm not opened my eyes to the Decimal data type. So far it's working slicker-than-cat-slobber. And he answered my main question 'WHY'. I mean, even a simple calculator...
Thanks alot johnwm. The Decimal data type has done the trick. Although using the name Decimal (Private A as Decimal) gives a compile error. I can however use the literal char for Decimal (Private A@). Seems to work great.
A star for you.
Thanks again.
Is there a logical explanation why the following code will not work?
I came across this problem in an app I'm working on where I have to increment a variable ('A') by .1 inside of a loop and If 'A'='B' then 'do something'. It works fine when 'B' is 1.1 or 1.2, but when it's 1.3 and above, it...
Hmmmm, I may be wrong but this is what I see.
If this is what you have in your list
CmbEfficiency.AddItem "Stechiometric", 0
CmbEfficiency.AddItem "Phd-50/HD-2000", 1
CmbEfficiency.AddItem "Fif-50", 2
CmbEfficiency.AddItem "Bags", 3
And...
It looks to me like your trying to print 4 tickets(or 4 somethings) per page. I wouldn't try another loop. Maybe just increment 1 variable inside the loop, like this
Private Sub Command1_Click()
Dim a As Integer
Dim nIndex As Integer
Dim x As Integer
Dim tickets As Integer
Dim y...
Probably the easiest way would be like this...
Dim textFile As String
Dim htmlFile As String
textFile = "YourPath\YourFile.txt"
htmlFile = "YourPath\YourFile.html"
Name textFile As htmlFile 'Rename the file to html
'Use it here
Name htmlFile As...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.