?
Solved

Please help me . VB6.0 something simple .

Posted on 2006-05-27
4
Medium Priority
?
160 Views
Last Modified: 2010-04-30
Hello experts .

I want to make something very simple on my project.. i want this project to calculating see example in my source
---------------------------------------------------
Private Sub Form_Load()
Pending.Text = GetIP
If Pending.Text = "1" Then
Pending.Text = "$39.95"
End If
If Pending.Text = "2" Then
Pending.Text = "$79.90"
End If
If Pending.Text = "3" Then
Pending.Text = "$119.85"
End If
If Pending.Text = "4" Then
Pending.Text = "$159.80"
End If
If Pending.Text = "5" Then
Pending.Text = "$199.75"
End If
If Pending.Text = "6" Then
Pending.Text = "$239.70"
End If
If Pending.Text = "7" Then
Pending.Text = "$279.65"
End If
If Pending.Text = "8" Then
Pending.Text = "$319.40"
End If
If Pending.Text = "9" Then
Pending.Text = "$359.35"
End If
If Pending.Text = "10" Then
Pending.Text = "$399.30"
End If
If Pending.Text = "11" Then
Pending.Text = "$439.25"
End If
If Pending.Text = "12" Then
Pending.Text = "$479.20"
End If
End Sub
---------------------------------

I dont want to put the price manual , can somebody tell me a more easy way to calculating $39.95 per number ?
0
Comment
Question by:KingSencat
  • 2
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
nffvrxqgrcfqvvc earned 2000 total points
ID: 16777936
Option Explicit

Private Const Ratio  As Double = 39.95

Public Function FormatDollar(arg As Double) As Double
    FormatDollar = Ratio * arg
End Function

Private Sub Command1_Click()
    Text1.Text = FormatDollar(5)
End Sub
0
 

Author Comment

by:KingSencat
ID: 16777965
Not helping . can you give me more info what  i put here ?

Private Sub Form_Load()
Pending.Text = GetIP
If Pending.Text = "1" Then
Pending.Text = "$39.95"
End If
If Pending.Text = "2" Then
Pending.Text = "$79.90"
End If
If Pending.Text = "3" Then
Pending.Text = "$119.85"
End If
0
 

Author Comment

by:KingSencat
ID: 16777974
ok is work thx
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 16777980
You might want to explain better because the only thing it looks like your trying to do is just multiplying the value 39.95 by the value in the Pending textbox. But then again when you do this for a value of 12 it doesn't match what you have so I am actually confused to wheter this is what your trying to do or if you just calculated wrong.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month13 days, 23 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question