How to Multiply $50 times, by how many was input in the textbox?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anoble1
    New Member
    • Jul 2008
    • 246

    How to Multiply $50 times, by how many was input in the textbox?

    I am working on trying to calculate a penalty, I have 2 text boxes. On of them is where a user inputs a number like "2" (We will call that textbox Z) then their is another txt box under it that I want to be the Total txtbox.

    So, I want to multiply the user input number by $50.00 and create a Total in the next textbox. I can't seem to get it right.

    I have done a "After Update" on the txtbox Z

    Code:
    Private Sub txtLateGB_AfterUpdate()
    
    txtLateGBCost.SetFocus
    
    txtLateGBCost.Text = (Forms!frmFeeder!frmPenaltiesIncentives.txtLateGB.Text) * (50#)
    
    End Sub
    I'm just trying to get it to multiply their number by $50 and trying to get it to show up in the other textbox instantly. That's why I did an after update hoping that would do it.

    Thanks!!!
  • Rodney Roe
    New Member
    • Oct 2010
    • 61

    #2
    use the change event

    Code:
    Private Sub txtbLateGB_Change()
        txtbLateGBCost = txtbLateGB * 50
    End Sub

    Comment

    Working...