Click here to Skip to main content
15,899,637 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Label Array HELP Pin
PAguilar095-Nov-09 23:03
PAguilar095-Nov-09 23:03 
GeneralRe: Label Array HELP Pin
Sigurd Johansen6-Nov-09 10:18
Sigurd Johansen6-Nov-09 10:18 
GeneralRe: Label Array HELP Pin
PAguilar096-Nov-09 19:23
PAguilar096-Nov-09 19:23 
GeneralRe: Label Array HELP Pin
Sigurd Johansen7-Nov-09 7:23
Sigurd Johansen7-Nov-09 7:23 
GeneralRe: Label Array HELP Pin
PAguilar097-Nov-09 15:45
PAguilar097-Nov-09 15:45 
GeneralRe: Label Array HELP Pin
DaveAuld6-Nov-09 21:30
professionalDaveAuld6-Nov-09 21:30 
QuestionOutlook Contact Picture Path Problem Pin
dcdhingra5-Nov-09 18:15
dcdhingra5-Nov-09 18:15 
QuestionHelp with Modules-specifically subprocedures Pin
bphoopstar5-Nov-09 18:12
bphoopstar5-Nov-09 18:12 
I have this program where I need to use multiple forms. Which hasn't been a problem. The program also needs to include a module in order to create a procedure to keep a running total of a number which is added in two different forms. It then needs to be displayed on the third form.

I am having problems making this number calculate on my display. Can anyone help?

Here is the module

'This is the Standard Module'
Option Strict On

Module Module1

Public Sub AddToOrder(ByVal intTotalSales As Integer, ByRef dblSubtotal As Double)

        dblSubtotal = dblSubtotal + intTotalSales

End Sub

Public Function Taxes() As Double

Dim dbltaxRate As Double = 0.07
Dim dblSubtotal As Double

Return CDbl(dblSubtotal * dbltaxRate)


End Function


End Module


Here is the Display Form:

Option Strict On
Public Class frmDisplay

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click

        'Closes the Bill 
        Me.Close()

    End Sub

    Private Sub frmDisplay_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'When the form is loaded, the date is going to appear as well as the total amount due for all coffee ordered'

        Dim todayDate As Date = Today
        txtBoxDate.Text = todayDate.ToString

        'declare'
        Dim decSalesTax As Decimal
        Dim decSubtotal As Decimal
        Dim dblSubtotal As Double
        Dim intTotalSales As Integer
        
        'calculate'
        decSalesTax = CDec(Taxes())
        decSubtotal = AddToOrder(intTotalSales, dblSubtotal)

        'display'
        txtBoxSubtotal.Text = decSubtotal.ToString
        txtBoxTax.Text = decSalesTax.ToString
        txtBoxTotal.Text = txtBoxSubtotal.Text + txtBoxTax.Text


    End Sub


End Class

AnswerRe: Help with Modules-specifically subprocedures Pin
Christian Graus5-Nov-09 19:00
protectorChristian Graus5-Nov-09 19:00 
Questionhow to read data from store procuder in dataset ? Pin
Pitou HORT5-Nov-09 16:41
Pitou HORT5-Nov-09 16:41 
AnswerRe: how to read data from store procuder in dataset ? Pin
Christian Graus5-Nov-09 19:01
protectorChristian Graus5-Nov-09 19:01 
GeneralRe: how to read data from store procuder in dataset ? Pin
Pitou HORT5-Nov-09 19:46
Pitou HORT5-Nov-09 19:46 
GeneralRe: how to read data from store procuder in dataset ? Pin
Christian Graus5-Nov-09 20:16
protectorChristian Graus5-Nov-09 20:16 
GeneralRe: how to read data from store procuder in dataset ? Pin
Pitou HORT5-Nov-09 21:01
Pitou HORT5-Nov-09 21:01 
Questionappend menustrip items Pin
ivo755-Nov-09 7:51
ivo755-Nov-09 7:51 
AnswerRe: append menustrip items Pin
Christian Graus5-Nov-09 11:04
protectorChristian Graus5-Nov-09 11:04 
AnswerRe: append menustrip items Pin
The Man from U.N.C.L.E.5-Nov-09 22:54
The Man from U.N.C.L.E.5-Nov-09 22:54 
Question0.2+0.1<>0.3 in For Pin
The real $M@5-Nov-09 7:14
The real $M@5-Nov-09 7:14 
AnswerRe: 0.2+0.1<>0.3 in For Pin
Gideon Engelberth5-Nov-09 7:37
Gideon Engelberth5-Nov-09 7:37 
AnswerRe: 0.2+0.1<>0.3 in For Pin
Ian Shlasko5-Nov-09 7:50
Ian Shlasko5-Nov-09 7:50 
GeneralRe: 0.2+0.1<>0.3 in For Pin
The real $M@6-Nov-09 8:35
The real $M@6-Nov-09 8:35 
Questiondatadase binding to a check box Pin
rbjanaki5-Nov-09 3:48
rbjanaki5-Nov-09 3:48 
AnswerRe: datadase binding to a check box Pin
Jay Royall5-Nov-09 4:09
Jay Royall5-Nov-09 4:09 
GeneralRe: datadase binding to a check box Pin
rbjanaki5-Nov-09 5:43
rbjanaki5-Nov-09 5:43 
GeneralRe: datadase binding to a check box Pin
Jay Royall5-Nov-09 5:51
Jay Royall5-Nov-09 5:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.