Solved

VBasic update

Posted on 2000-05-04
3
194 Views
Last Modified: 2010-05-02
ok, i have my second program running and it goes to the third form...now i am stuck...i do not know where to begin with my coding to get started.I have the interface already started.I have 2 option buttons and they are:optVisa which is a Visa card option and optMast which is my Mastercard option...I also have 2 command buttons:cmdRec which primts my receipt of all the customers information(address,item purchased,price,tax, total price,shipping information,purchase order number,etc.) and cmdOrder which will calculate my total price where the cmdRec button can print it...and then i have text boxes for the user to enter in their information needed for shipping...this is my second form and it is fine...my third form and what i have so far on it is at the bottom of the page...like i said i do not want this program done for me...i just want some hints on how to start the coding...

Private Sub Check1_Click()
    txtComment.Visible = True
End Sub

Private Sub cmdRum_Click()
    Dim Song As String
    Dim Quantity As Integer
    Dim Price As Integer
    Dim Genre As String
    Dim x As Boolean
    Dim strPrompt As String
    x = True
   
    Open "a:\music store.txt" For Input As #1
    Do While Song <> Combo1.Text
    Input #1, Song, Quantity, Price, Genre
    Loop
   
   
    If Song <> Combo1.Text Then
       MsgBox ("bet you wish I had it")
       x = False
    End If
   
    If txtQuantity > Quantity Then
     Prompt = "Sold Out"
       x = False
       
       Else
        If Option1.Value And Genre = "Tape" Then
        strPrompt = "Not available as CD"
           
            Else
             If Option2.Value And Genre = "CD" Then
             strPrompt = "Not available as Tape"
       End If
         If strPrompt <> vbNullString Then MsgBox strPrompt
               
                If x Then
                Unload Form2
                Form3.Show
                End If
           End If
        End If
   
     
         
     Close #1
End Sub

THIRD FORM

Private Sub cmdOrder_Click()

End Sub

Private Sub cmdRec_Click()
lblT = Song
lblP = Val(txtQuantity) * Val(Amount)
End Sub

Private Sub PurchaseOrderNo()
    lblPur2 = Int((5000 - 500 + 1) * Rnd + 500)
End Sub

Private Sub optVisa_Click()

End Sub

0
Comment
Question by:Jenny30
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
AnswerTheMan earned 100 total points
Comment Utility
write some, check some, and so on...
say to yourself out loud what you want that will happened in any event. once you say it or write it in plain words - you'll know what you have to do. write some, check some....and remmeber : every jurney starts with one little step. step by step you'll build it by your own.
0
 

Expert Comment

by:sniperrus
Comment Utility
I haven't dealt with flat file access in VB, but that first loop you have looks like it may be infinite, it only checks if the strings match it doesn't check if the end of the file is reached. Then again VB might do that for you, as I said I really don't know (in other languages it would be infinite thuogh that's why I thought about it).
0
 
LVL 5

Expert Comment

by:AnswerTheMan
Comment Utility
Jenny30 :
i'm surprized to be awarded points and A grade for this answer.
it was meant to be a comment.
you may find it hard to belive, but belive it : even after  more then 12 years of code-writing, and hundreds of projects behind me - i expierince the same
filling that i felt in your question - when i start a new project.
*BUT* - my experience made me know how to traet that feeling in proportion and ALL I WANTED is to pass that experience to you. that is all.

tnx, and i wish you success. EE is a good place to get help on uncleared POINTS here and there.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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…
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now