INSTRUCTIONS FOR CREATING THE QUOTE FORM
One last form to go! The FRMQUOTE.FRM form. This form has 30 objects. OBJECT PROPERTY VALUE 1. Form Name FrmQuote Caption Price Quote WindowState Maximized 2. Frame Name FraPkg Caption Choose 1 3.Option Button Name OptStandard Caption Standard 4.Option Button Name OptDeluxe Caption Deluxe 5. Frame Name FraModels Caption Choose One 6.Option Button Name OptStar Caption Star XL 7. Option Button Name OptComet Caption Comet JS 8. Option Button Name OptOrbit Caption Orbit J10 9. Textbox Name TxtTrade Fontsize 12 10. Textbox Name TxtName Fontsize 12 11.Command Button Name CmdExit Caption Exit 12.Line 13. Line 14. Image Name ImgPrint Stretch True Picture Icon 15. Image Name ImgCompute Stretch True Picture Icon 16. Label Caption Print Autosize True 17.Label Caption Compute Autosize True 18. Label Name Lbltotal Caption blank at first, we’ll calculate and display a total here at runntime 19. Label Name LblStax Caption blank at first, we’ll calculate and display a tax here at runntime 20. Label Name Lblsub Caption blank at first, we’ll calculate and display a sub-total here at runntime 21. Label Name LblPkg Caption blank at first, we’ll calculate and display a dealer package price here at runntime 22.Label Name LblBase Caption blank at first, we’ll calculate and display a base price here at runntime 23. Label Caption TotalPrice Autosize True FontSize 12 24. Label Caption Subtotal Autosize True FontSize 12 25. Label Caption Sales Tax Autosize True FontSize 12 26. Label Caption Trade-In Autosize True FontSize 12 27. Label Caption Package Autosize True FontSize 12 28. Label Caption Base Price Autosize True FontSize 12 29. Label Caption Name Autosize True FontSize 12 30. Label Caption Venus Motors Price Quote Autosize True FontSize 18 Now we need to do the programming. When the user clicks EXIT we want to show the title form and hide the quote form: FrmTitle.Show FrmQuote.Hide When the user hits the compute image, we want to calculate a quote and display it on the screen. We are going to be using a new function called VAL Syntax: Val(stringexpression) Remarks: The argument stringexpression is a sequence of characters that can be interpreted as a numeric value. The Val function stops reading the string at the first character that it cannot recognize as part of a number. Val also strips blanks, tabs, and line feeds from the argument string. For example, the following returns the value 1615198: Val(" 1615 198th Street N.E.") For the ImgCompute_Click: code: LblSub.Caption = Val(lblbase.caption) + val(lblPkg.Caption) + -Val(TxtTrade.Text) LblStax.Caption = Val(LblSub.Caption) * .05 LblTotal.Caption = Val(LblSub.Caption) + Val(LblStax.Caption) If the user selects the print image, we want to print the form: PrintForm When the user selects an option box for a base model, we need to set the default prices: Lblbase.Caption = 15500 (if Comet if clicked) Lblbase.Caption = 21000 (if Orbit is clicked) Lblbase.Caption = 10500 (if Star is clicked) When the user selects an option box for a base model, we need to set the default prices: LblPkg.Caption = 2000 (if standard dealer package is selected) LblPkg.Caption = 3000 (If deluxe dealer package is selected) Finally, in order for your printform to work properly, we might need to set the height and width of the form object in a load event. The unit of measure is called a twip. There are 1440 twips in one inch. Height = 15840 Width = 12240 Be sure to save under FRMQUOTE.FRM