Solved

VBasic 6.0 help

Posted on 2000-05-06
4
159 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 90 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 code to programmatically convert pdf to excel 21 92
using Access 8 68
converting visio 2010 to powerpoint 2010  - formatting issues 5 72
Automatic Email Reminder 4 38
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

810 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