Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Convert Figure To Currency

I recently had to create an app where i had to work out how much pennies a person would have at the end of a 30 day period.

The question was:

'Today, Ill give you a penny. Tomorrow, Ill give you two pennies. Ill keep doubling the amount that I will give you for 30 days. How much will you have at the end of the month?'

After working this out, the person would have 1073741823 pennies.
What i would like to do is, at the press of a button, convert this 10 digit figure into pounds (sterling), and having it displayed as currency.

What i though of doing was:

currency = total / 100
lblsterling = currency

Would this work, or is there another way of converting it to currency?

Thanks in advance for your help

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Figure To Word Convert
Hello All,

Is it possible ? , any function or other to solve my trouble.
Im using vb6 i want to convert the figure into words.
means when i enter 420 ,it will Automatically convert into Four Hundred And
Twenty Only
Any idea?
Pls Reply

Convert To Currency
I have aproblem I working on Is This correct... I assume that all variable have been declared

Write a code that will convert currency. Assume listbox(lstCurremcy) has the following foreign currency (index in parenthesis): (0)Pesos, (1) Euros, and (2) Yen. Use the following conversion rates: Pesos (8.25 to $1), Euros (1.35 to $1), and Yen (1.26 to $1). The user should select an entry in the listbox and place a dollar amount in txtDollar. Youre to convert the amount in txtDollar to the foreign currency and place your answer in lblConvert.
Public Sub ConvertToCurrency (Number) as Integer
If lstCurrency(listindex). Peso then
lblConvert=xtDollar * .0825
Elseif lstCurrency(listindex).Euros
lblConvert=txtDollar* .0135
Elseif lstbox lstCurrency(listindex).Yen
lblConvert=txtDollar *.0126
End if

End Sub

Convert Currency Into Words?
Hello there,

does anybody knows how to convert currency into words? for example: $ 1,206.31 = one thousand two hundred six dollar and thirty one cents. pls give it a shot.


Convert Currency Into Words
Hello there,

does anyone knows how to convert a currency eg. 11,258.64 into words.

pls help. thanks in advance.

I Want To Convert Currency From One To Another......please Help Me [ Urgent ]
I have listview(listinvoice) in my form, it contains 6 columns, serial number, products,Produc Description, quantity, unitprice and Amount.I have one textbox(txtTotal) on same form. It displays the sum of items in column "Amount". I also have one combobox(cmboConverter) on the same form. Combobox contains items, such as "US dollar","Australian Dollar", "Singapore
Dollar", etc. And default currency is Nepalese currency. And the value of other currencies corresponding to Nepalese Currency are stored in my database(eg. lets say 1 USD equals 78 Nepalese currency). All i want to do is that whenever i change the currency format in combobox. It will convert to the currency format that i changed in combobox equivalent to the currency that was previously on that textbox.
I also want to change the columnheader from "Amount" to "Amount(USD)" if i change the combobox item to "US DOLLAR".

Please anyone help me with this, i'll be really grateful.

Quote The Quotation-"The height of great men, reached and kept were not attained by
sudden flight, but they when their companions were slept, toiled upward in
the sky."

Edited by - saracjl on 4/5/2005 4:50:50 AM

Help Me Figure Out How To Convert 3 Ascii Characters Into Time?
I am making a stats program for the game half-life, if i send a string to the server through udp, i get back a packet that has the player info, which contains their name, how many frags they have and also 3 ascii characters that somehow represent their time in the game... name is easy, its just written in normal letters, the frags is a single character ascii but it is easy to figure it since you just use Asc() to turn it into a a number
Well i have been stuck on the player's time in game for a while now, it is 3 ascii characters, im not sure if you have to do anything with hex, or anythign else, but i cant figure it out, here is a list of the characters ive put together and along with that their APROXAMATE time i use another program to retrive, ive went ahead already and converted the ascii charactes into their numbers using the Asc() function

Maybe someone with more brain power can figure how i would turn the 3 characters into seconds, i belive it is in seconds, but i dont think just multiplying or deviding will work... IF YOU CAN SOLVE THIS MYSTRY I WILL BE GREATFUL, thanx a bunch!


67 37 32 <-42m
67 245 29 <-42m
179 72 18 <-39m
51 24 19 <-39m
179 23 19 <-39m
51 22 19 <-39m
179 13 19 <-39m
143 132 16 <-38m
143 84 14 <-37m
71 7 13 <-37m
143 147 9 <-36m
102 216 255 <-34m
102 222 246 <-32m
102 126 242 <-32m
133 99 242 <-32m
102 252 232 <-31m
102 186 223 <-29m
31 34 211 <-28m
133 87 212 <-28m
31 22 181 <-24m
102 247 168 <-22m
102 235 138 <-18m
102 122 139 <-18m
102 120 139 <-18m
102 112 139 <-18m
102 125 139 <-18m
102 126 139 <-18m
142 203 130 <-17m
28 93 68 <-13m
28 91 68 <-13m
28 85 68 <-13m
28 83 68 <-13m
28 75 68 <-13m
28 71 68 <-13m
28 61 68 <-13m
28 37 68 <-13m
28 13 68 <-13m
28 123 67 <-13m
11 65 54 <-12m
28 177 1 <-8m
124 124 239 <-7m
22 14 234 <-7m
22 10 234 <-7m
22 254 233 <-7m
22 250 233 <-7m
22 234 233 <-7m
22 226 233 <-7m
22 206 233 <-7m
22 158 233 <-7m
22 110 233 <-7m
22 74 232 <-7m
247 16 90 <-3m
247 8 90 <-3m
247 240 89 <-3m
247 232 89 <-3m
247 200 89 <-3m
247 184 89 <-3m
247 144 89 <-3m
247 48 89 <-3m
247 208 88 <-3m
247 136 86 <-3m
44 108 73 <-3m
47 163 13 <-2m
225 56 225 <-1m

oh, and if it helps any, i looked in the protcol readme for this information, and it says
players name is a string
players frag is int32
and for the players time in game, it says its float32
btw, the protocol was also meant for C++

How Do You Convert Values Into Currency Format
i am using visual basic 6.0 and on one of my forms i need to do a calculation that calculates the difference between incomings and expenses-i have figured out this code and the code works fine

Heres the problem, at the moment in the textbox the user can enter anything, i want it so that the user can just enter numbers-and the textbox format will be currency-i dont know how this works-maybe when the user enters for example 100 this will automatically convert into (when the user goes to next textbox) 100.00-if there is a code for this please post below cuz i am really stuck-
here is the code i have at the moment

Private Sub cmdCalculate_Click()

txtProfit.Text = Val(txtIncomings.Text) - Val(txtOutgoings.Text)

If Val(txtProfit.Text) > 0 Then
txtProfit.ForeColor = vbGreen
txtProfit.ForeColor = vbRed
End If

If Val(txtIncomings.Text) > Val(txtOutgoings.Text) Then
lblResult.Caption = "You made a profit!"
lblResult.Caption = "You made a loss!"
End If

End Sub

Verify String Can Convert To Currency
Is there a function that checks if a String value can convert to another datatype?

Convert Numeric Currency To English
Hi all,

In VB6, is there anyway to convert numeric currency amount to English words? For example, when a program gets input $100.00, it outputs One Hundred Dollars 0 Cents.


Convert A (cdbl(text1.text) To Currency?????
I have a few textboxes that I need to be converted to currency for printing purposes.... can someom please assist?



Convert Currency To Words (Indian Format) In Crystal Reports
Please can anyone help me how to convert number to words in Indian format in Crystal Reports.
eg. I want to convert Rs.25,12,000 as Rupees Twenty Five Lakhs Twelve thousand only.
The towords function converts into millions and billions and i want the result in Lakhs and crores.

Thanks in advance.

Insert Currency Data Type To MS Access Currency Field
Im want to insert a into a currency field in ms access using vb 6.0 but i keep gettin an error message. What should i place around the value to denote insert it.
here is my code:

VB Code:
Dim sqlstmt As String            sqlstmt = "INSERT INTO tbl_Products (ProductName,ProductDesc,SalesPrice,SpecialOffer,SpecialOfferPrice) VALUES (" & _              "'" & p_prodName & "', " & _              "'" & p_prodDesc & "', " & _              "'" & p_sPrice & "', " & _              "'" & p_specialOffer & "', " & _              "'" & p_soPrice & "' " & _              ")" MsgBox sqlstmt    db.Execute (sqlstmt)

Numeric Currency Value To Word Currency Value
Guys I want to know how we can change Numeric Value of currency to the Word value.
for Ex. If we enter value in textbox 210 after clicking a button change, it will display in the label that Two Hundred ten only in label.
I want at least for up to 5 digit.

So I want this type of program for VB Give me whole coding for that Or attach the whole created project that u have done plz help me.

By the way, Happy DIWALI & new YEAR , It is Indian Festival.

I Just Can't Figure This Out..
It's like I'm almost there, but not quite. I'm just trying to make a simple listbox with numbers in it. When you hit go, it'll go down the list and save it into a text file. Then, if you load those numbers again and hit go, it'll check the text file, if the number is already there a message box will pop up and say "already in text!", if not, it'll just continue with saving the numbers in the text.

Here's the vb code and I've attached the files

Option Explicit
Dim strFile As String
Dim strBuff As String

Private Sub add_Click()
List1.AddItem Text1.Text
End Sub

Private Sub go_Click()

Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
If List1.ListIndex = List1.ListCount - 1 Then
MsgBox ("Done!")
Timer1.Enabled = False
List1.ListIndex = List1.ListIndex + 1
End If


If strBuff = List1.Text Then
MsgBox ("already in text!")
'MsgBox ("not in text!")
End If

'If strFile = strBuff Then
'MsgBox ("already in text!")
'MsgBox ("not in text!")
'End If

End Sub

Sub ReadFromFile()
Dim FF As Integer
FF = FreeFile()
Open App.Path & "MyFile.txt" For Input As FF
strBuff = Input(LOF(FF), 1)
'Label1.Caption = strBuff
Close FF

End Sub

Sub SaveToFile()
strFile = List1.Text
Dim FF As Integer
FF = FreeFile()
Open App.Path & "MyFile.txt" For Append As FF
Print #FF, strFile
Close (FF)
End Sub

Can't Figure Out How They Do This...
This may not be the place to ask...if not maybe someone can recommend the best forum to ask this question.

I am interested in using the Inet control in MS Access to programmatically send a website information that would normally be filled in by a user. I have done this successfully now on a number of websites but then I ran into this one. From a prior post, I got a reply that indicated that if info can be enetered into browser page then it can be done in Access(VB). To date this person was correct. In this case I believe I do do not know enough and this is why I am here.

Here is the URL I am working with :

Here is some of the HTML source on the form for entering Last Name and Company Name:


<TD ALIGN=center> <INPUT TYPE=SUBMIT NAME="SEARCH_BUTTON.PAPROFILE.PAM" VALUE="Search" TABINDEX=17 TABORDER="17" Onclick="return search_subchk();"> </TD>

When I looked at this stuff previously I concluded I would not be able to work with this website, but, now after successfully working with a couple of other sites I decided to come back to this one and try again. Can anyone with some knowledge of this kind of HTML confirm:

1. I am just wasting my time here. This type of HTML cannot be remote scripted. Stop beating your head against the wall and you'll feel better!


2. The previous person that told you anything a browser can do you can do in VB is correct and here is what you need to do in this case.


3. Buddy, you type to much go away!

Thanks in advance for the very helpful advice!!

Ok, I Cant Really Figure This Out... Need Help!

Public PlayerName As String 'Player's name
Public PlayerType As Boolean 'Player's type (true=warrior|false=defender)
Public PlayerDef As Integer 'Player's defence
Public PlayerStr As Integer 'Player's strenght

***frmMain.frm (start form)***

Private Sub cmdNewgame_Click()
If optWarrior.Value = True Then
PlayerType = True
If txtName.Text = "" Then
PlayerName = "null"
End If
End If

If optDefender.Value = True Then
PlayerType = False
If txtName.Text = "" Then
PlayerName = "null"
End If
End If
End Sub

in frmmainIi have 1 textbox for name, 2 buttons; newgame and quit, and 2 option boxes. (warrior and defender)

***frmGame.frm (game form)***

Private Sub Form_Load()
If PlayerType = True Then
PlayerDef = 3
PlayerStr = 5
End If
If PlayerType = False Then
PlayerDef = 5
PlayerStr = 3
End If
lblDef.Caption = PlayerDef
lblStr.Caption = PlayerStr
lblName.Caption = PlayerName
End Sub

3 labels


If i choose warrior i get 5 str and 3 def, ok
if i choose defender i too get 5 str and 3 def (?)
my name wont show up, i forgotton to add: playername = txtName.text, just remembered it now.

what about str and def? when i dimmed em they wont show up at all!


Can't Figure Out
Hello guys,

I have created a code that should open an excel file previously created.

Here's what I have so far:

Sub searchfile()

Dim oExcel As Excel.Application
Dim busqueda

Set oExcel = CreateObject("Excel.Application")

''I put the excel's file name in Range("A1") of the spreadsheet. The excel
file was saved on c:

busqueda = "c:" & Range("A1")

oExcel.Workbooks.Open Filename:=busqueda

End Sub

The point is that when I execute the code, I don't get any error, but the spreadsheet doesn't open.

Could you please help me out?

Thanks a lot.


Can't Figure This Out...
I'm working on a program that lets the user create their own labelboxes, as much as they want, and write w/e they want in them. The program also lets the user drag the labelboxes they make around the form. I need to make it so the user can create a new level and move it where ever they want.

Here's the code for both.

Move Label:

Option Explicit

Dim cX, cY As Long
Private Sub Form_Load()

Dim obj As Object
Set obj = Label1.Container
End Sub

Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
cY = y
cX = x
End Sub

Private Sub Form_DragDrop(Source As Control, x As Single, y As Single)
Set Label1.Container = Form1
Label1.Top = y - cY
Label1.Left = x - cX
End Sub
Create Labels:

Private Sub Label1_Click(Index As Integer)
Dim i As Long

i = Me.Label1.UBound + 1 'get the next available index
Load Me.Label1(i)
With Me.Label1(i)
.Move Me.Top = 100, Me.Left = 100 'Rnd * Me.ScaleWidth, Rnd * Me.ScaleHeight 'place random on form
.Visible = True 'invisible by default
End With
End Sub

Private Sub Form_Unload(Cancel As Integer)
Dim i As Long

If Me.Label1.UBound > 0 Then
For i = 1 To Me.Label1.UBound
Unload Me.Label1(i)
Next i
End If
End Sub
Here's the problem.
To move the labels, the label has to have the property "DragMode = 0-Automatic". To create a new label, you need to have the main label set to index 0. But if Label1 has an index, the DragMode disapears from the code properties.
I've been stuck on this for a few days now, I can't figure out what to do.


Can't Figure Out How To..
00 626 "Name" St_4d:60

I want to get the name in between the " " and put it into the string.


Figure This One Out..
My app has gone haywire. Well not really, but it is doing something weird I should say.

When my app runs, after you login, MDIForm1 loads with frmMain as a childform maximized.

At random times (not sure if it is being triggered or not, if it is.. i don't know what is triggering it), frmMain decides to restore down in MDIform1. When I double click the title bar to maximize it, it will shortly restore down again, at random.. sometimes very quickly, other times several minutes later.

Here is some code I'm using:


Private Sub Form_Load()
With nid
.cbSize = Len(nid)
.hwnd = Me.hwnd
.uId = vbNull
.uCallBackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon
.szTip = "GaragePRO" & vbNullChar
End With
Shell_NotifyIcon NIM_ADD, nid
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'this procedure receives the callbacks from the System Tray icon.
Dim Result As Long
Dim msg As Long
'the value of X will vary depending upon the scalemode setting
If Me.ScaleMode = vbPixels Then
msg = X
msg = X / Screen.TwipsPerPixelX
End If
Select Case msg
Case WM_LBUTTONUP '514 restore form window
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Case WM_LBUTTONDBLCLK '515 restore form window
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Case WM_RBUTTONUP '517 display popup menu
Result = SetForegroundWindow(Me.hwnd)
Me.PopupMenu Me.mPopupSys
End Select
End Sub

Private Sub Form_Resize()
Image1.Move (ScaleWidth - Image1.Width) / 2, (ScaleHeight - Image1.Height) / 2

If Me.WindowState = vbMinimized Then Me.Hide

End Sub


Private Sub Form_Unload(Cancel As Integer)
Shell_NotifyIcon NIM_DELETE, nid
End Sub
Aaaaaanny ideas at all?

Cant Figure It Out...
Private Sub Timer3_Timer()
If Garage.Text17.Text = "0" Then
Text4.Text = "0"
Timer3.Enabled = False
If Val(Text4.Text) > Val(0) Then
Garage.Text5.Text = Text4.Text
MsgBox "You ran out of Nitrous Oxide!"
Timer3.Enabled = False
Text4.Text = Text4.Text - 1
Garage.Text5.Text = Text4.Text
End If
End If
End Sub

It wont run If Val(Text4.Text) > Val(0) Then
It runs everything else right. If text17= 0 it runs that correctly. Runs the else correctly after If Val(Text4.Text) > Val(0) Then. Why wont it run If Val(Text4.Text) > Val(0) Then tho? ive tried it with the symbol < and > still dont work. Whats wrong whatd i miss?

Can't Figure It Out
I'm using the Data control in one of my programs, but for Some
reason when ever I refresh the control. I get a Error stating:

DAO.Workspace #3170
Couldn't find Installable ISAM.

This only happens while I'm running it from within VB. If I compile it to an
EXE, it will work fine. but there's a problem with the code and I can't
debug it like this.

What does this mean and how can I fix it.
Can anyone help?

Can't Figure It
I am almost finished making a messenger but the color doesnt work. I want the connected, disconnected, kicked and hosted text in red. i would like the name in blue and other peoples names in red. i would like the text in black. it just doesnt seem to work.

txtDialog.SelColor = vbBlack
Dim i As Integer
If sckConnect.State = sckConnected Then
SendList.Add "[Message] " & txtName.Text & ": " & txtMessage.Text
SendTo.Add "sckConnect"
For i = 0 To giMaxConnections - 1
If sckConnection(i).State = sckConnected Then
SendList.Add "[Message] " & txtName.Text & ": " & txtMessage.Text
SendTo.Add "sckConnection(" & i & ")"
End If
Next i
End If
txtDialog.Text = txtDialog.Text & txtName.Text & ": " & txtMessage.Text & vbCrLf
txtMessage.Text = ""

Can't Figure This Out
ok, here we go. I have got this cool prog and all, i get this error when compiling it:

Complie Error:

Invalid Use of Propery

then this is the part of erranous code:

Public Sub InitForms()
ShowIcon MainForm
Load (this LOAD is highlighted) AddUser
Load MainForm
Load AppSettings
End Sub

what is wrong? do i need to post more information? sorry, im kind of n00b-ish at this

Cant Seem To Figure Out How To Do This
I basically have 2 for's, then a function that requires a non-duplicate integer, otherwise it will pave over the previous one

For i = 0 to 5
For m = 0 to 5
ExampleFunction x, p * 50, m * 25

But i need to make the "x" go up each time I or M goes up, to keep from overwriting my previous number, so when the it first hits, and i hits "1", x should increase by 1, and then do the same for m as well.I've spent 3 good hours trying different loops, whiles, and for's but i cant seem to figure this out.

Any help is appreciated.

Can't Figure It Out....
i know how to add text from a *textbox to a *listbox but how do you add all the items from a listbox to a textbox? thanks for any help.

I Can't Figure It Out!
Hello all,
I have a homework which I have almost done it, but only one program I can't figure out how to do it.

I should click on a "Command Button" then it should print on screen the following shape:



and also in another command button I should do this:



can anybody help me with it..


Thanks in advance

Trying To Figure This Out...
I recently made a program for searching logs... Though It works, but I'm trying to make it faster.... hopefully you guys can enlighten me.

VB Code:
Private Sub btSearch_Click()Dim Count As IntegerDim Results As StringDim i As IntegerDim OneFile As String DisableControlsLoadWordListProgressBar1.Value = 0 If Option1.Value = True Then    FindInText "", tbContent.Text, Count, ResultsElse    ProgressBar1.Visible = True    For i = 1 To AllFiles.Count        On Error Resume Next        Open AllFiles.Item(i) For Input As #1        OneFile = Input(LOF(1), #1)        FindInText AllFiles.Item(i) & vbTab & ":", OneFile, Count, Results        Close #1        Dim NewValue As Integer        NewValue = ProgressBar1.Value + ((FileLen(AllFiles.Item(i)) / 10) / AllFilesSize) * 100        If NewValue < 100 Then            ProgressBar1.Value = ProgressBar1.Value + ((FileLen(AllFiles.Item(i)) / 10) / AllFilesSize) * 100        Else            ProgressBar1.Value = 100        End If    Next    ProgressBar1.Visible = FalseEnd If Form3.tbCount.Text = CountForm3.tbResults.Text = Results EnableControls Form3.ShowEnd Sub Private Sub FindInText(Label As String, Text As String, ByRef Count As Integer, ByRef Results As String)Dim StartIndex, EndIndex, i As IntegerDim Sentence As String EndIndex = 0 While EndIndex < Len(Text)    StartIndex = EndIndex + 1    EndIndex = InStr(StartIndex, Text, vbLf, vbTextCompare)    If EndIndex = 0 Then        Sentence = Mid(Text, StartIndex)        EndIndex = Len(Text)    Else        Sentence = Mid(Text, StartIndex, EndIndex - StartIndex - 1)    End If        For i = 0 To Form2.lbWords.ListCount - 1        If InStr(1, Sentence, Form2.lbWords.List(i), vbTextCompare) > 0 Then            Results = Results + Label + Sentence + vbCrLf            Count = Count + 1        End If    NextWend End Sub

Please Help Me. I Can't Figure This Out -_-
Hello Everyone ^__^

Heres what I've done so Far...

I have a quick question. I'm trying to make a video store like thing and I need help with adding the subtotal and Total. I'm also having problems with spacing the movies titles on my purchase summery. I used tags for the all of the prices and tax.

What do I need to do to fix this?

Can't Figure This Out!
I am trying to make a logon system where by the username is a mixture between bd and any number from 0 to 85. Unfortunatley this is not going well i came up with the idea of using a For...Next loop but was unsuccesuful. My code is below.

VB Code:
Private Sub Command1_Click()Dim strFirst As StringDim intSecond As Integer For intSecond = 0 To 85    If Text1.Text = strFirst & intSecond Then        MsgBox "Login Complete"    Else        MsgBox "Login Failed"    End IfNextEnd Sub

Any ideas



I Just Can't Figure This Out..
It's like I'm almost there, but not quite. I'm just trying to make a simple listbox with numbers in it. When you hit go, it'll go down the list and save it into a text file. Then, if you load those numbers again and hit go, it'll check the text file, if the number is already there a message box will pop up and say "already in text!", if not, it'll just continue with saving the numbers in the text.

Here's the vb code and I've attached the files

VB Code:
Option ExplicitDim strFile As StringDim strBuff As String Private Sub add_Click()    List1.AddItem Text1.TextEnd Sub Private Sub go_Click()        'SaveToFile                    'ReadFromFile    Timer1.Enabled = TrueEnd Sub   Private Sub Timer1_Timer()If List1.ListIndex = List1.ListCount - 1 Then        MsgBox ("Done!")        Timer1.Enabled = False    Else        List1.ListIndex = List1.ListIndex + 1    End If                SaveToFile    ReadFromFile        If strBuff = List1.Text Then    MsgBox ("already in text!")    Else    'MsgBox ("not in text!")    End If        'If strFile = strBuff Then    'MsgBox ("already in text!")    'Else    'MsgBox ("not in text!")     'End If       End Sub Sub ReadFromFile()Dim FF As IntegerFF = FreeFile()Open App.Path & "MyFile.txt" For Input As FFstrBuff = Input(LOF(FF), 1)'Label1.Caption = strBuffClose FF   End Sub Sub SaveToFile()strFile = List1.TextDim FF As IntegerFF = FreeFile()Open App.Path & "MyFile.txt" For Append As FFPrint #FF, strFileClose (FF)End Sub

Cannot Figure This Out....
okay i have two list one contains just a normal list and the other list contains a list of index to remove(list of numbers) from list1. this probably seems similar to my other topic and that's what i thought, but i cannot figure this out no matter what even though it seems easy.

So list1 contains: apple, orange, peach, banana
list2 contains: 0, 2, 3

So after running the code, only orange will be left in list1.

VB Code:
Dim intCount As IntegerFor i = 0 To List2.ListCount - 1intCount = List2.List(i)List1.RemoveItem (intCount)intcount = intcount - 1 'updates count? not sure about this partNext i

Put Your Name Here, Or Not If I Can't Figure This Out.
I know this is most likely a dumber question than I hope, but I am stuck here. I searched for the answer qutie a bit, and maybe I just didn't search enough, because I wasn't satisfied with what I got. I'm building a game and the game requires (upon the start of a new game) you enter a name into a seperate form. There are certain requirements:

1) The box needs to disable you from being able to bring the main form into view. I have had several bugs with turning the Visible property to false with source, but if anyone could supply correct syntax I may find my error.
2) The textbox also needs to prevent the user from entering nothing but spaces for a name, and that means one space or twenty-one. Is there a way to do this without continuously entering:

VB Code:
' etc etcElseIf txtName = "             "      ' 13 spaces    ' msgbox preventing user from making this workElseIf txtName = "              "      ' 14 spaces    ' msgbox preventing user from making this workElseIf txtName = "               "      ' 15 spaces    ' msgbox preventing user from making this workElseIf txtName = "                "      ' 16 spaces    ' msgbox preventing user from making this work' etc etc  

as well as Mid functions plus trim functions and such to root out pasting and extra spaces at the end, etc. etc. The list goes on. My main concern is putting ElseIf up there 21 times. It seems excessive.

Currently I am simply using (with frmDialog and frmMain):

VB Code:
' source for frmDialogPrivate Sub Form_Load()    frmMain.Visible = False     ' source for the rest of stuff goes hereEnd Sub

It says there is syntax error, specifically on line two of that source.
Is there another type of box for input I do not know about? The input boxes and dialog boxes do not seem to work. I am leaning towards a dialog-based form, however, and if someone could supply me with the necessary source for disabling the main form and preventing the user from entering lots of spaces I would greatly appreciate it.


Help Figure This Out...
Ok here's the scenario...

i made a program under VB6.0 with Access DB as its backend, then i installed the components to all the clients. by that time the clients' MS Office version was Office 2002(XP), and the program works fine even now their Office was upgraded to 2003. Now there's one client who wants to have the program which i made to be installed in his computer and he has already Office 2003, after i installed all the components in his machine and run the program an error occured. its always like that, most especially in the middle of the operation. i want to know now if, is the hierarchy of upgrade of Office 2003 has something to do with my programs execution? will the error be eliminated once i retain the previous version of Office and install my program's components after that proceed with the upgrade of Office 2002(XP) to Office 2003? please help me..thanks a lot.

Still Can't Figure This Out
I am fairly new to VB and still learning so this may be something simple that I have overlooked. I have a form that has a few ways in which I can exit the app (a menu with 'Exit' as a command, and the 'X' in the top right hand corner of the window. Do I have to put the code I wish to execute on exit in both locations or can I just call the unload sub when I exit using the menu and how do I do that. I have the following code under the unload sub:

If DBConnect.rsGames.State <> 0 Then DBConnect.rsGames.Close
Dim x As Integer
For x = (Forms.Count - 1) To 0 Step -1
Unload Forms(x)
Next x
End If

I tried to just use 'Call Form_Unload' as the code under the coomand in the menu but this doesn't work. Is it a good idea to put it in a module seeing how I use the same code in several different places and then just call the module and then put
'end' after that?
Thanks in advance

Can't Figure It Out
Hello to all,

Here is what I am looking for.

Step A
I checked off all the customers in the list. Some customers may have an address while others don't. When I click the Print button, **only** customers with valid addresses will be printed out. That's when I called --->> Call GetCustomerBookMark(k)

Step B
On the other hand, If I clicked on the list and selected customers without no addresses, then no letters will be printed out for those customers. That's when I **DON'T called --->> Call GetCustomerBookMark(k). I just exit out. These are validation I am doing on the Print Button. See sample below.

My code works for Step A. How do you changed it to work for
Both Step A and Step B.

Data in the ListView

Names Address City State Zip
[X] Don Joe **has no address **
[X] Ben Joe **has no address**
[X] Sally 1 Pine Street
[X] Jorge 3030 Mapel Street

With the code below, letters will be printed for
Sally and Jorge only because they have an address.
See code below which works for Step A.

Private sub PrintCustomer()

call VerifyAddress

end Sub

Private Sub VerifyAddress()

Dim k As Integer
Dim intpos As Integer
Dim CustID As Long
Dim strCustNames As String
Dim strMsg As String

If Me.LvwCustomer.ListItems.Count > 0 Then
For k = 1 To Me.LvwCustomer.ListItems.Count
If Me.LvwCustomer.ListItems.Item(k).Checked Then
intpos = InStr(1, Me.LvwCustomer.ListItems.Item(k).Key, "C", vbTextCompare)
'use for other uses.
CustID = CLng(Mid(Me.LvwCustomer.ListItems.Item(k).Key, 2, Len(Me.LvwCustomer.ListItems.Item(k).Key) - intpos))

If Len(Trim(Me.LvwCustomer.ListItems.Item(k).SubItems(5))) = 0 And _ 'address
Len(Trim(Me.LvwCustomer.ListItems.Item(k).SubItems(6))) = 0 And _ 'apt
Len(Trim(Me.LvwCustomer.ListItems.Item(k).SubItems(7))) = 0 And _ 'City
Len(Trim(Me.LvwCustomer.ListItems.Item(k).SubItems(8))) = 0 And _ 'state
Len(Trim(Me.LvwCustomer.ListItems.Item(k).SubItems(9))) = 0 And _ 'zip
Len(Trim(Me.LvwCustomer.ListItems.Item(k).SubItems(10))) = 0 Then 'country
'uncheck the Customer that has no address
Me.LvwCustomer.ListItems.Item(k).Checked = False
strCustNames = strWitNames & LvwCustomer.ListItems.Item(k) & vbTab & _
LvwCustomer.ListItems.Item(k).SubItems(1) & " " & LvwCustomer.ListItems.Item(k).SubItems(2)
If Len(Trim(strCustNames)) > 0 Then strWitNames = strCustNames & vbCrLf
strMsg = ("No letters will be printed for the following Customer") & vbCrLf & "" _
& "____________________________________________ " & vbCrLf & strCustNames & vbCrLf
End If
Call GetCustomerBookMark(k)
End If
Next k
MsgBox strMsg, vbInformation + vbOKOnly, "No Letters Printed"
End If
End Sub

I have a hard time getting it to work.

thanks a bunch.

Nobody Has Been Able To Figure This Out
I need to have multiple web browsers in the same form all with separate proxies, can this be accomplished. If so please respond to this message.

I Just Can't Figure This One Out :(

This is a VBA question.

I have one form in my access database that does NOT want to co-operate with me.

Whenever I try to open the form I get the following message, which does not really say what the problem is ( i think).

"The expression On Load you entered as the event property setting produced the following error: Member already exists in a object module from which this object module derives.

* The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].
* There may have been an error evaluating the function, event, or macro."

What could possibly be causing this problem?
Here is the code I have in the form open and form load events. Keep in mind that this exact code works on one of my other forms.....strange!!!!! So I'm thinking my problem is somewhere else but I have NO IDEA!

VB Code:
'Access code Private Sub Form_Load()        Me.TimerInterval = 1000    Me.Label21.Caption = Format(Now(), "hh:MM:SS")        Set db = CurrentDb()        Me.Frame29.Value = 2        'Open the port and setup the communications control    Call SetupCommControl(Me.Name, "MSComm1") End Sub Private Sub Form_Open(Cancel As Integer)    'get the default color and title values     OpenForm    Me.FormHeader.BackColor = BackGround    Me.FormFooter.BackColor = BackGround    Me.Detail.BackColor = BackGround    Me.Text2.ForeColor = ForGround    Me.Text2 = TitleLine    Me.Text12.ForeColor = ForGround    Me.Text12 = MyName    Me.Text14.ForeColor = ForGround    Me.Text14 = Format(Now(), "mm/dd/yy")    Me.Text23.ForeColor = ForGround    Me.Text23.Value = "Inventory Exit Screen"     Me.BarCodeSerial.Visible = True    Me.BarCodeUnit.Visible = True    Me.EmployeeBarCode.Visible = True    Me.Qty.Visible = True            If Me.Frame42.Value = 1 Then        Me.Qty.Visible = True    Else        Me.Qty.Visible = False    End If     If Me.Frame29.Value = 0 Then        Me.BarCodeSerial.Visible = True        Me.BarCodeUnit.Visible = False        Me.EmployeeBarCode.Visible = False    End If    If Me.Frame29.Value = 1 Then        Me.BarCodeSerial.Visible = True        Me.BarCodeUnit.Visible = True        Me.EmployeeBarCode.Visible = False    End If    If Me.Frame29.Value = 2 Then        Me.BarCodeSerial.Visible = True        Me.BarCodeUnit.Visible = True        Me.EmployeeBarCode.Visible = True    End If End Sub

Please help!!!

I Cant Figure This **** Out Help Me!!
OK....this has been making me mad, i cant seem to figure it out, ive been trying to do this for like 4 months.

I have madea program that will recive information from a half-life server, mainly for the mod counter-strike, if you send the string "players " to the server using udp winsocks then the server will respond witha packet chuck full of players and their frags and their TIME IN GAME(this is what i need help on)
i already have all the code to rip apart the packet and take the player names and frags, etc, but when it comes down to the players' time in game i cant seem to figure out how to turn the packet characters into seconds

for the time in game of each player there is 3 ascii characters which represents the time in game and i can not figure out how the characters are turned into seconds(no, the 3 charactaers arent hours, min, sec) if you turn the characters into decimal i still cant figure it out, here ill post what i have so far maybe someone can please help me, this has been bugging me forever....

This font should be in Terminal, but i got those number from another program that could actually find times(the other program is written in C and i have the source if someone knows C and can covert it to VB, if not just try to figure out how those times came from those 3 ascii characters, i also posted the half-life protocol info at the bottom, the times are estimated or rounded...


+Ež 43 69 63 about 21 min
n 214 244 110 about 15 min
!ž 235 33 63 about 21 min
ޝ 7 222 157 about 21 min
Š 171 63 157 about 20 min
– 255 213 63 about 20 min
x 172 120 174 about 5 min

here is the entire string the server game to me
i got this from winsocks udp by sending the string "players " to
the server, thats 4 ascii char's which is 255 players and a space,
then the server responds with this, might want to change this to terminal font for easy reading.

D__Wem _ +EžD_[xTc]Chimbi _ nD_Retarded Exterminator
!žD_Elmo _ΦD_El Diablo
ŠD_Antioch _ σ–D_DickSoup _ x⌐C

This is what the half-life server protocol says about the
string i recived...

Server responds with the following packet:
(byte)ASCII 'D' (players response, S2A_PLAYER)
(byte)active client count

for each active client
(byte)client number / index
(string)player name
(int32)client's frag total
(float32)client's total time in-game

Can Someone Help Me Figure Out What This Does?

is it a screen saver of sorts ????
I think it lets ya select videos to play so they act as a screen saver ???
I don't have vb anymore, I can't get it to work on xp right now, so I can't compile it, any help would be welcomed.

Who Can Figure This Out?
An application contains two forms: frmrate and frmtax. The frmrate form's load event procedure needs to use a variable named strstate.

The click event procedure for the cmddisplay control, which is on the frmrate form, also needs to use the strstate variable. The click event procedure for the cmdcalc control which is on the frmtax form, needs to use a variable named curStateTax.

Both the cmddisplay and cmdcalc controls' click event procedures need to use a variable named sngstaterate. (remember that the cmddisplay control is on the frmrate form and the cmdcalc control is on the frmtax form.)

Write the appropriate statements to declare " the strstate, curstatetax, sngstaterate variables.
Also write down where you will need to enter each statement and whether each variable is, a local, form-level, or global variable.

Can't Figure Out Why..-need Help Please
OK. I am writing this program and i put in two scrollbars, a vscroll and an h scroll. The vscroll which I tried putting at the edge of the right part of the screen goes to far right(he's called v1) and my hscroll which i tried putting at the bottom of the form(he's called h1) doesn't show at all and by what i checked it's because for some reason he goes down to much. This is my form_activate which places the v1 and h1 scrollbars. I am also adding a screen shot of my form. Thanks in advance.
Private Sub Form_Activate()
c1.Filter = "DataFiles (*.dat)|*.dat"
v1.Top = 0
v1.Height = Form1.Height
v1.Width = 255
v1.Left = Form1.Width - v1.Width
h1.Top = Form1.Height - h1.Height
h1.Left = 0
h1.Width = Form1.Width
pp1.Left = Form1.Width / 2 - pp1.Width / 2 - v1.Width / 2
End Sub

You CAN NOT Figure This Out!
Now that I have your attention...sorry

This is my first time using SQL 2000. How can I bring back in a RS ALL the Questions and Responses that are relationally joined to the Sections table? Can I just ask for Sections 1 and return all the other related info?

Any help is appreciated!

Please look at this diagram of my DB at the link below to understand what I am asking.


Can Anyone Help Me Figure It Out?
I'm working on an assignment called "Map Maker".
What I am supposed to do is first place 25 blank image boxes on a form, and select one of the images displayed right below those blank image boxes, and put it into a blank slot, and I should be able to load and save the final result, but what I like to know is that if it's possible to 'drag and drop' an image from one image box cotaining an image to a blank box.
At first, I thought it wouldn't be really difficult, but after struggling to figure it out for a while, I got to realize that this could be much harder than I'd expected.
Any anwers or opinions would be appreciated.
Thank you in advance.

Can Anyone Help Me Figure This Out?
I asked the same question today, and many nice folks gave me their opinions, thanx again, but I still have a problem solving it.
The idea is simple, but as a beginner it isn't all that easy to me.
So far I've managed to write this code,

Private Sub startButton_Click()
Dim myARR(0 To 9)
For i = 0 To 9
myARR(i) = (Int(Rnd * 100) + 1)
Print myARR(i)
Next i
End Sub

, which will generate random number between 1 to 100 and display them on the form, but I have no idea how to sort them in numerical order. Can anyone help me about this?

Can Someone Figure This One Out?
i am loading a for that has a listbox in it.The listbox is set up as
Checkbox style.
So i login to a DB and see if the Privledge is set to true or false.
if it is true i want to Check the box
and if it is false uncheck the box?????????

here is the code.

lstCount = lstPrivs.ListCount
lstStart = 0
i = 0
dbUserType.Name = frmUsrTyp.cboUsrTyp.Text

For i = lstStart To lstCount Step 1
lstPrivs.ListIndex = lstPrivs.ListIndex + 1
If lstPrivs.Text <> "mBLANK" Then

blnUserType = dbUserType.HasPrivilege(lstPrivs.ListIndex)
If blnUserType = True Then
lstPrivs.ListIndex = vbChecked
lstPrivs.ListIndex = vbChecked
End If

lstPrivs.ListIndex = vbUnchecked
End If
lstPrivs.ListIndex = -1
Exit Sub

Figure This Out....
I have my Microsoft Windows Common Controls 6.0(SP3) out on my toolbox. I built my project saved, shut down for the night. Now i go back to load it, and when i go to run my program, VB tells me that it can't find the project or library (it highlights a line where declare a ListView object).

I have re-installed VB, re-installed SP3, rerun VBdlls.exe, controls.exe. And am out of ideas? Anyone else ever have this problem??

Anyone Able To Figure This Out
I would like automate the downloading of file with my custom browser how can I set the browser up to do the same as right clicking and clicking save target as without dialog boxes?

I Can&#039;t Figure It Out..

I have a progressbar IN a statusbar (by some api calls from another thread (tip by Matthew Gates))

My problem is this: I'm using the Form_resize event to change the progressbar's position accordingly (because it won't do it by itself). Whenever I'm resizing everything is fine, but when Minimizing or Maximizing the StatusBar must be (I think) resizing later because the Progressbar doesn't size also.

What should I do? Subclassing? Hooking? Swearing?

Help, please!

Copyright 2005-08, All rights reserved