Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VBasic 6.0 help

Posted on 2000-05-06
4
Medium Priority
?
168 Views
Last Modified: 2010-05-02
ok i only have 90 pts left so what i need now is how to get my tax and total price to print in my picture box
btw...my State code will be going in the txtState textbox

here is what i have

Private Function tax() As Single
Dim sTax As Single

If txtState <> "MS" Then
     sTax = 0
Else
    If txtState = MS Then
       sTax = Price * 0.07
    End If
End If
tax = sTax
0
Comment
Question by:Jenny30
  • 2
4 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2784742
you should be able to do it the way you printed all the other information...

btw, even if i help you solve this, give these points to AZWolf
0
 
LVL 9

Accepted Solution

by:
GivenRandy earned 360 total points
ID: 2784759
Like this:

Pic1.Print Tax

Also, you can reduce your Tax() function to the following -- it is smaller, faster, easier to read, etc.

Private Function Tax() As Single
    If txtState <> "MS" Then
        Tax = 0
    Else
        Tax = Price * 0.07
    End If
End Function

This is PROVIDED you meant the second

   If txtState = MS Then

to be

   If txtState = "MS" Then

instead.  Did you?
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2784763
i'm sure thats what it should read
0
 

Author Comment

by:Jenny30
ID: 2784773
thank you...it works now...everyone has been so helpful to me...i intend to take VBasic as far as i can b/c i want to know it like an expert...this is my first programming language that i have taking at school...it is a requirement in the LAN Networking curriculum...we went over If,then,else and Case statements;Data files;the fartherest we got were Loops, but i intend to do a little studying on my own...i believe the language is really interesting and intend to take it farther than what i have learned...Thank you all for your help...
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

824 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