Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Addition

Posted on 2004-04-18
6
Medium Priority
?
201 Views
Last Modified: 2010-05-02
I would like to know the formatting on the addition of two labels that are numbers.

curPartsandTax1 = Val(txtPartsCharge1.Text) * 1.08
    curLaborHours1 = Val(txtLaborHours1.Text) * 30                        Example
    lblPartsandTax1.Caption = FormatNumber(curPartsandTax1, 2)   59.99
    lblLaborDollars1.Caption = FormatNumber(curLaborHours1, 2)    1,374.00
    lblJobTotal1.Caption = FormatNumber(curPartsandTax1, 2) _
    + FormatNumber(curLaborHours1, 2)                                         59.991,374.00  ???
   
0
Comment
Question by:gonzal13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 10855012
lblJobTotal1.Caption = FormatNumber(curPartsandTax1, 2)  + FormatNumber(curLaborHours1, 2)

The FormatNumber() function returns a String object, and the "+" operator means Concatenation for Strings, so try this instead:

lblJobTotal1.Caption = FormatNumber(curPartsandTax1 + curLaborHours1, 2)

Regards,

Idle_Mind
0
 
LVL 13

Author Comment

by:gonzal13
ID: 10954815
Please close out this question

gonzal13(Joe)
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 150 total points
ID: 10959389
Did my solution work gonzal13?

If not, please explain the problem further or post your own solution and request a refund.  

Idle_Mind
0
 
LVL 13

Author Comment

by:gonzal13
ID: 10961616
I had not looked at this site since I had posted another question that helped me get started on the project.

This is the final code:

'Maintain a list box.
'Use dropdown combo box
'Use command Buttons



Private Sub cboClear_Click()

    'The list is named cboCombo1
    'The command clears the Combo1 list
   
    cboCombo1.Clear
   
End Sub

Private Sub cboCombo1_Change()

End Sub

Private Sub cboCount_Click()

    'The ListCount command is used with the message box
    'to view the number of lines in the list
   
    MsgBox "The number of Types is " & cboCombo1.ListCount
End Sub

Private Sub cboPrint_Click()

    'The ListCount returns the number of items in a list
    'If no item is selected, the ListIndex is set to -1.
    'The first item in the list is ListIndex 0 and ListCount
    'is always one more than the largest List Index
    ' Index is a database object that provides access to
    'Data in rows of a table, based on key values.
 
    Dim intIndex As Integer
    Dim intFinalValue As Integer
 
    intFinalValue = cboCombo1.ListCount - 1
    For intIndex = 0 To intFinalValue
    Printer.Print cboCombo1.List(intIndex)
    Next intIndex
    Printer.EndDoc
   
End Sub

    'vbExclamation dislays using the Msb Box a
    'message found in quotes. Usually a warning Message.
    'Private Sub cmdADD_Click()
    '
    'If cboCombo1.Text <> "" Then
    'cboCombo1.AddItem cboCombo1
   
    'Else
    'MsgBox "Blank data", vbExclamation, "Error"
    'End If
    'End Sub


Private Sub cmdExit_Click()

    End
   
End Sub

Private Sub cmdRemove_Click()

   'A combo box control combining the features of a text box
   'and list box.
   'This control allows the user to select an item either
   'by typing into a ComboBox or by selecting it from a list.
   'Remove an item from a ListBox or Combo Box.
   'object.RemoveItem.Index
   'vbInformation Display information using a combo box
   
   If cboCombo1.ListIndex <> -1 Then
    cboCombo1.RemoveItem cboCombo1.ListIndex
    Else
        MsgBox " First select Item to remove", vbInformation, _
        "No Selection made"
   
    End If
   
End Sub

Private Sub cmdSort_Click(Index As Integer)

    'Take the combo box list, name the row and sort

    cboCombo1.Recordset.sort = "bagles"
   
End Sub


'Private Sub mnuADD_Click()

'End Sub
'Private Sub mnuFile_Click()

'End Sub
Private Sub Form_Load()

End Sub


gonzal13(Joe)
0
 
LVL 13

Author Comment

by:gonzal13
ID: 11026175
I would like to close this question out. I klnow all of you had spent time in helping me. Before I looked at any of your comments, I found the answer in the text book. I have 2000 points and would gladly give someone the points, but there are so man notes, that I do not think it is fare to award points to any one person.

Sincerely

gonzal13(Joe)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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

670 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